Speedup hint for users of viewcvs package 
Author Message
 Speedup hint for users of viewcvs package

-----BEGIN PGP SIGNED MESSAGE-----

Hello Peter,


Quote:
> Explanation: viewcvs.cgi is a ~ 68 kB source file.  After applying
the
> procedure outlined above, this is compiled into a byte code file.
> So there is no longer recompilation needed on each cgi request.

This can, of course, be applied to almost every python CGI script.
OTOH,
one might think about going straight with mod_python anyway...

Best regards,
 Gabriel

-----BEGIN PGP SIGNATURE-----
Version: PGP 6.0.2i

iQEVAwUBOsTMXsZa2WpymlDxAQHkHgf/YG6S+hK6+gyUxbajlSF7uHLpPGXX5fuT
3frRagE44403hCsZNPj1c/RxjEtdsP/6kXwqJCDCP4JKPMRMQ47xgfuAgGhlTPHV
rb4rrPmT8lha3pWx9ScQZ07JVWu14nYjgqIRa+Pj3+S5UoTelrLJZ4qsaU07aX+D
D0V9qYh68oDc+p/BtE85kZbEyamMstA87ybIDNJFOXYUSmsajyhQSB2PCCiIc4HU
wZ1+VGwlUgeD4Hb+VkGOhqWUqMxESi3tLFHpOSGNSrYlUL2klZJ4W2oywVKOeUR6
BLJI62yS6qAZDiTE1sWDPDJ1HXKtCQSp63SYj1Jyn/cOYbvn/Pwikg==
=hbU0
-----END PGP SIGNATURE-----



Wed, 17 Sep 2003 03:11:41 GMT  
 Speedup hint for users of viewcvs package
Greg Stein has written a very useful Python application called viewcvs
which is availble at http://www.lyra.org/viewcvs/

Greg: if you read this: Thank you.  The following note applies to
viewcvs version 0.6

I've installed it here in our company, because compared to cvsweb viewcvs
offers syntax colorized views of the source codes.

But people complained, that viewcvs was a lot slower compared to cvsweb.cgi.
Fortunately this was really easy to fix:
 (1) go into the viewcvs installation directory and there into the
     sub directory cgi.  you need write permissions there. Example:
        # cd /usr/local/viewcvs-dev/cgi
 (2) Rename the file viewcvs.cgi to viewcvs.py:
        # mv viewcvs.cgi viewcvs.py
 (3) fire up the interactive Python interpreter, type 'import viewcvs'
     and leave it with Ctrl-D.
 (4) fix the permissions of the byte code file 'viewcvs.pyc' generated by
     step (3) to make it world readable.
 (5) Place the following snippet into a file viewcvs.cgi there:
         #!/usr/bin/python
         import sys, os
         sys.path.insert(0, os.path.dirname(sys.argv[0]))
         import viewcvs
     you may have to fix the path to your Python interpreter.
 (6) Try it from your web browser on your and you should be able to
     observe speed pretty similar to cvsweb.

Explanation: viewcvs.cgi is a ~ 68 kB source file.  After applying the
procedure outlined above, this is compiled into a byte code file.
So there is no longer recompilation needed on each cgi request.

Regards, Peter
--
Peter Funk, Oldenburger Str.86, D-27777 Ganderkesee, Germany, Fax:+49 4222950260
office: +49 421 20419-0 (ArtCom GmbH, Grazer Str.8, D-28359 Bremen, Germany)



Wed, 17 Sep 2003 02:57:35 GMT  
 Speedup hint for users of viewcvs package

Quote:

> one might think about going straight with mod_python anyway...

No, you want mod_fastcgi.  Witness:

  $ ab -n 20 http://spud/cgi-bin/viewcvs.cgi/
  ...
  Requests per second:    2.33
  Transfer rate:          20.02 kb/s received

  $ ab -n 20 http://spud/cgi-bin/viewcvs.fcgi/
  ...
  Requests per second:    58.31
  Transfer rate:          501.57 kb/s received

It took about 15 minutes and 15 lines of code to convert
viewcvs.cgi to viewcvs.fcgi.  I have no idea why more people
don't know about FastCGI.

  Neil



Wed, 17 Sep 2003 06:15:05 GMT  
 Speedup hint for users of viewcvs package

Quote:

> I have no idea why more people don't know about FastCGI.

I once tried it but without success. Can you point us to recent
version of Python modules and examples?

Ciao, Michael.



Wed, 17 Sep 2003 08:22:54 GMT  
 Speedup hint for users of viewcvs package

| I have no idea why more people don't know about FastCGI.

one reason is probably that mod_fastcgi doesn't come with apache
(because of the license?) and then it's just as easy to download
and compile and configure mod_python or mod_snake.

  -- erno



Wed, 17 Sep 2003 10:15:05 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Hint for Eiffel/S users with DJGCC or GNU-EMX back-ends

2. Need a hint for a Haskell problem (hint, not solution)

3. ViewCVS 0.9.2 released

4. ViewCVS 0.9.1 released

5. ViewCVS 0.9 released

6. ViewCVS 0.8 released

7. ViewCVS: CVS Repository Viewing thru the Web

8. viewCVS on win98

9. viewcvs rlog error

10. Rexx NT traps in a SAA user function package

11. include user defined packages in my design

12. User authorisation problem with http package

 

 
Powered by phpBB® Forum Software