Hello,
I have a virtual machine in one hosting company that will use to host my site. Since the installation do everything alone. OS is Ubuntu Hardy, Kernel 2.6.24-25-virtual, VMware tools the last version, the host machine is a VMware ESX 4 with processors Intel (R) Xeon (R) CPU E5405@2.00GHz. For my virtual machine are allocated 256MB of RAM, restricted to use up to 450 Mhz processor during a Xeon and I have a 100Mbit-flat channel to the Internet. My problem is the following when I decide to test the performance of Apacha and from my laptop run ab-c 10-n 100 http://mysite.com/ or ab-c 20-n 20 in http://mysite.com/ get console response:
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/Benchmarking mysite.com (be patient)...apr_poll: The timeout specified has expired (70007)
Load of my server is just over 20, CPU-it is almost 100 percent all the time. top show about memory following thing:
Mem 255764k total, 231156k used, 24608k free, 12432k buffers
Swap: 401400k total, 100K used, 401300k free, 110376k cached
In the first 20-21 lines shows apache2. I watched the top around, 40 minutes, values remain almost unchanged. Execute /etc/init.d/apache2 stop waiting 4-5 min but nothing happen. For that reason execute killall -9 apache2 and loading the machine decrease.
My question is what is the reason for this overload of apache.I guess something fundamentally wrong.
Here is what I changed from the default settings. In /etc/apache2/apache2.conf:
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 20
MaxRequestsPerChild 1024
</IfModule>
Overrideis prohibited anywhere. Instead .htaccess files use the directives in /etc/apache2/httpd.conf for the specific directory where it should have .htaccess file.
In /etc/php5/apache2/php.ini I change:
post_max_size = 256M
upload_max_filesize = 200M
max_execution_time = 300 ; Maximum execution time of each script, in seconds
max_input_time = 600 ; Maximum amount of time each script may spend parsing request data
memory_limit = 128M ; Maximum amount of memory a script may consume (16MB default)
I installed eAccelerator according to the instructions here My configuration in /etc/php5/conf.d/eaccelerator.ini is as follows:
extension="eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/var/cache/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="0"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="10"
eaccelerator.shm_prune_period="10"
eaccelerator.shm_only="1"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
In /etc/mysql/my.cnf I change this:
max_allowed_packet = 128M
My file system is reiserfs mounted with the following options relatime,noatime,notail
Thanks in advance!