Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have some Trac installations running on my Ubuntu/Apache web server and I've noticed that when I monitor the CPU usage while accessing Trac pages that it is not uncommon for the CPU to spike up to a 100%. It concerns me that this happens with just one user accessing the system.

Is there a way I can make accessing Trac on my web server less CPU intensive?

share|improve this question
add comment

5 Answers 5

up vote 3 down vote accepted

I have found mod wsgi to be faster than mod python.

I posted a writeup on how to setup Trac with mod_wsgi here

share|improve this answer
    
Good effort. I will give it go and see what happens. Thanks for the good write up! –  Luke Jun 29 '09 at 11:52
    
I also changed from mod_python to wsgi (debian/etch -> debian/lenny) because of performing issuses. –  ThorstenS Jul 26 '09 at 19:56
add comment

For information: There's a discussion about that point at http://trac.edgewall.org/ticket/7490. They are referring to performance issues with KeepAlive in Apache2.x with mod_python.

Quoted from follow up 17: with keepalive on we got constant 80% CPU utilization on our server with keepalive off we got constant 15% CPU utilization on our server CPU load comes from Apache processes

share|improve this answer
    
I tried switching between KeepAlive On and Off but I do not see much difference. –  Luke Jun 27 '09 at 4:03
2  
@Luke Why did you accept this as the answer then? –  Scott Dec 21 '09 at 18:04
add comment

There was also a similar question on the Trac ML, probably it help you (in particular the last mail with a possible configuration of Apache): ML Mail (Google Groups) " Trac 0.11 so slow!!!!!"

Edit Probably, but as I didn't have such problems, this could be also from interest for you: performance and garbage collection. However, I don't think this is the case here...

Edit #2 Just remembered that with the next stable release the performance problem will be gone (if it is because of mod_defleat). See also the Dev-ML: Preparing next stable release (first point after the "However...")

share|improve this answer
add comment

If you have mod_deflate enabled, try disabling it.

share|improve this answer
    
It made some difference but not much. –  Luke Jun 26 '09 at 22:24
add comment

It also depends on your database. Which database server are you using? Is it on the same host as your Trac server? Are you sure the CPU usage is coming from Apache?

Personally I've found trac runs better on mod_fastcgi, and even better on mod_wsgi. We're using a VM on a modestly spec'd VM host to host our Trac instance and it's in constant use (as in being refreshed every few seconds) by around 20 employees without any problems.

share|improve this answer
    
I'm using the default SQLite set up. I'm using htop to monitor the CPU usage on the server and I can see the Apache thread spike up. –  Luke Jun 26 '09 at 22:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.