Some quick PHP performance stats: suPHP vs prefork+mod_php vs itk+mod_php

I have been doing lots of research on how to properly secure PHP on a shared server, especially with regards to finding the best way to sandbox users. On stock apache installations, the apache user must have access to web content in order to serve it which has the unfortunate side effect that every user on the shared hosting server can read the files of every other user.

The solution to them is "sandboxing" them, or in other words having Apache serve each user's web files as that user. I will post a tutorial relatively soon detailing how to do so (along with configuring many other services) but in the mean time here are some benchmarks:

prefork: 2.720166 seconds
suphp: 13.621006 seconds
itk: 4.263002 seconds

These benchmarks were generated using the "ab" benchmark included with the httpd server. They represent the time it took to load the front page of my blog 200 times:
ab -c 1 -n 200 http://www.firewing1.com/
prefork is the standard apache MPM working with mod_php. It's the fastest, but for the reasons outlined above also the most insecure. suPHP tackles the problem by using a SUID executable and running PHP under CGI, but it is extremely slow - even for this modest drupal site, it is just over 5x slower than stock. I compiled the ITK MPM for Apache which also offers the feature of running files under different users but it is based on Prefork and uses mod_php. The performance is still worse (2x slower) than stock, but much better than suPHP.

Rating: 
Tags: 

Comments

There is no single response to these sorts of Assignment help issues, everything relies on upon what is bringing on the moderate down. Commonly it isn't PHP code execution itself, since on present day equipment PHP code is executed immediately contrasted with things like system dormancy. Frequently it is things like the PHP issues database questions, and the database is ineffectively outlined, or inadequately recorded, so inquiries take quite a while. This is a unique instance of doing an excess of work to benefit a solicitation.

I recently came across your blog and have been reading along. I thought I would leave my first comment. I don't know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often. www.embossitworld.com navigate here

The intricate architectonics patterns to replica watches absorption induced watch authoritative mechanisms are all allotment of the watches on auction at. This is one of the best online shops for watches of all kinds. The Scandinavian watches to Swiss mechanisms, the address has got it all. Their accumulating varies badly to accouterment a deluge of needs, from accidental outings to adventuresome activity contest and even has a acclimatized accumulating to accouterment a austere breach like that of a wedding. The Scandinavian Replique montre accessible actuality as allotment of their acclimatized and badly affluent accumulating is accepted for accepting intricately brash and intelligently crafted. The mechanisms abaft are of the a lot of able and technologically advanced, aimed to activity chump achievement and aswell accommodated their needs for accuracy, acumen and precision. The website offers some of the best watches, accepting its accumulating categorised Replique Omega as best or classic, fleet and accidental wears. The aim is to be acclimatized and all-around abounding to accouterment the address of any and every breach calmly and aural affordable ranges. To lath able chump account http://www.xmontres.org and achievement is the adage of this website, something they crop complete seriously, dedicatedly and plan aloft efficiently.

I have been checking out a few of your stories and i can state pretty good stuff. I will definitely bookmark your blog