[rt-devel] performance problems

Palle Girgensohn girgen at pingpong.net
Wed Jan 14 21:27:46 EST 2004


Hi!

I have a pretty old piece of hardware: Dual Pentium III @ 450 MHz. 786 MB 
RAM, but I've never had real performance problems with it before, not until 
RT came along.

I use FreeBSD 4.9, perl 5.8.2, apache 1.3.29. I started out using mod_perl, 
but it sucked more than 50 Megs per apache process, and standard setting is 
10 processes... I tried lowering the number of processes, but even better 
was setting up RT with fastcgi. now there's only one perl process running 
and the machine does not swap anymore. nice. :)

Still, performance is bad (my impression is that performance is about the 
same for fastcgi and mod_perl, after lowering the number of httpd processes 
w/ mod_perl). Also, it is not PostgreSQL beeing the main performance hog, 
it is Perl. I've read all these tons of performance discussions on the 
lists, but they all relate to tuning postgresql. in my case, postgresql 
does take almost a second to do its job, but that only a 6th of the time 
taken to serve one klick.

I checked this by first looking at top which says perl uses 90% and 
postgres uses 2-4%.

apache logs a request to take 6 seconds, which is pretty typical. of this, 
824 ms are used by postgres, perl et al takes the rest. And, of all the 
time spent in postgresql, half of it, 423 ms, is spent asking one SQL query 
over and over again:
 SELECT  * FROM Principals WHERE PrincipalType ILIKE 'User' AND ObjectId = 
'22'

it is indeed a fast query, it takes a couple of milliseconds most of the 
time, but it is run 82 times. For one single klick saving a "resolved 
ticket, marked as deleted", 82 times. How come? This could be optimized a 
bit, perhaps? (My postgresql is pretty well optimized and is vacuumed every 
night.)

Never the less, perl seems to be the cpu monster here, using over five 
seconds to handle this, and at full cpu throttle. no swapping, there's 
memory left. one single user on RT, no load at all apart from RT.

I'll try rebuilding perl with a fresh gcc-3.3 with lots of optimizations 
and see if it helps, but it can't really help more than a few percent.

Any ideas

/Palle





More information about the Rt-devel mailing list