Reducing Apache Load
May 24, 2007
My load average seems a bit high considering how few processes are running:
[url]
Is there anything I can do to reduce the load generated by Apache?
You can see the Apache2 server status info here:
[url]
It's serving 20-25 requests per second, which are mostly these tiny requests to tracker.php which issues a database query and returns an image. The relevant httpd.conf settings:
Code:
Timeout 120
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 15
<IfModule prefork.c>
StartServers 8
MinSpareServers 5
MaxSpareServers 20
ServerLimit 512
MaxClients 256
MaxRequestsPerChild 4000
</IfModule>
This is a dual Opteron 2212 server (4 cores total) with 4GB RAM.
View 9 Replies
ADVERTISEMENT
Feb 20, 2008
I have a HUGE blog with over 15,000 posts that constantly runs the mysql database like NONE other.
I am just wondering, is there a way to reduce load? I am top 100,000 in Alexa and I get over 2,000 uniques / day. What can I do about this?
View 7 Replies
View Related
Jan 2, 2013
I'm going to use my apache server to host files(it works with a php script so we can't use FTP for now...) so I was wondering if I could limit this virtual host's bandwidth per second so the websites on the other virtual hosts still load properly. Any module for apache on windows which can do this?
View 2 Replies
View Related
May 1, 2013
I'm trying to improve the performance of my website and noticed that https pages take really long to load:
[URL] ....
[URL] ....
It appears this problem is caused by using https, because when I open my site without https it loads pretty quickly.
[URL] ....
From what I can see it appears that the main problem is the time to first byte, so my question is how can I reduce this?
My virtualhost for SSL is set like this:
Quote:
<VirtualHost 46.249.47.12:443>
DocumentRoot "C:Program Files (x86)Apache Software FoundationApache24htdocssite 2"
ServerName www.elitegameservers.net
ServerAlias elitegameservers.net
ErrorLog "logs/xgclan.com-error.log"
[Code] ....
I have replaced the real paths with "PATH" for security reasons. How to reduce the time to first byte in general. I tried setting up memcache to accomplish this but I didn't notice any changes...
This is my mem cache config:
Quote:
<IfModule mod_mem_cache.c>
CacheEnable mem /
MCacheSize 10000000
MCacheMaxObjectCount 100000
MCacheMinObjectSize 1
MCacheMaxObjectSize 262144
</IfModule>
Update: Just ran the openssl speed command [URL] ....
View 11 Replies
View Related
Mar 1, 2015
I've just switched my Apache and PHP config over to linux(ubuntu 14.10).
Apache 2.4.12 is using the mpm-event worker and PHP 5.6 is running in FastCGI/fpm mode.
I'm running MariaDB 10.0.17
I'd like to reduce the time to first byte even more, its currently 80 ms for static files and 110ms for PHP generated pages.
1. 80 ms seems like a lot, since the ping to the server is <15ms
How can I reduce this? Are there some tweaks for the Linux networking stack or Apache that I can apply?
I'm also using SSL, I remember it could be tweaked to improve its performance but I don't remember how..
I currently enabled the following in my main apache config:
Code:
ServerSignature Off
ServerTokens Prod
TraceEnable off
EnableMMAP on
EnableSendfile on
UseCanonicalName On
2. Is there a mod_spdy for Apache 2.4? what about http 2.0?
3. Can I tell PHP to make use of unix sockets to connect to the database server? (I heard unix sockets is faster)
4. I've installed memcached for PHP, can I also use this for Apache?
View 5 Replies
View Related
Feb 16, 2008
What are the best ways to reduce server power consumption?
I have a Dell Poweredge 860 (2.4ghz QC, 5GB RAM, 2 HDs) and it uses 0.46AMPs when running normally. The problem is at boot up it spikes for a few seconds here and there to about 0.6 and this is a real problem as I only have a 0.5AMP allowance.
Should I underclock it? Remove the CD Drive?
View 2 Replies
View Related
Jan 17, 2007
I have a server Athlon 3000+ 64bit, 1GB ram on Debian 3.1 and I have a problem with apache (apache is generating large load). On server are 1 phpbb board with ~80 members online. Frequently cpu load generating by apache jumps to 100%, next apache eats all memory & swap and next server downs. Sometimes in such moments on board are not much people (30-40), so this problem isn't related to online stats. I haven't any idea how fix this problem. Please, help me! I need fast help, because I will departure day after tomorrow and if I don't fix this problem before, my site will down over long time...
My config:
apache2.conf
Quote:
Timeout 100
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 15
<IfModule prefork.c>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 100
<IfModule worker.c>
StartServers 4
MaxClients 200
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 1
<IfModule perchild.c>
NumServers 2
StartThreads 5
MinSpareThreads 5
MaxSpareThreads 10
MaxThreadsPerChild 5
MaxRequestsPerChild 5
AcceptMutex fcntl
my.cnf (mysql):
Quote:
[mysqld]
log-slow-queries = /var/log/mysql/mysql-slow.log
long_query_time = 1
key_buffer = 10M
myisam_sort_buffer_size = 34M
join_buffer_size = 1M
read_buffer_size = 1M
sort_buffer_size = 2M
table_cache = 2500
thread_cache_size = 628
wait_timeout = 3
connect_timeout = 3
tmp_table_size = 50M
max_allowed_packet = 10M
max_connect_errors = 10
#query_cache_limit = 25M
query_cache_size = 100M
#query_cache_type = 1
query_prealloc_size = 16384
query_alloc_block_size = 16384
tmpdir=/tmp
log = /var/log/mysql/log.log
[mysqld_safe]
open_files_limit = 8192
[mysqldump]
quick
max_allowed_packet = 10M
[myisamchk]
key_buffer = 64M
sort_buffer = 64M
read_buffer = 16M
write_buffer = 16M
Eaccelerator: ON (before instalation was problem with apache too)
View 10 Replies
View Related
May 23, 2007
On 19th of may apache started to make like 3x more load on server. Before in cpanel admin panel load for biggest site was ~5 and now it is 18-30. Also on server peaks are now up to 2-3 and before it was rarely 1. I'm only admin so i know i didnt touch anything from configuration because i wasn't much around. And users said they also didn't modified anything.
So i suspect maybe there was some cpanel update which makes apache to have higher loads.
Traffic is at normal visits per day and hits only load is 3x higher.
View 2 Replies
View Related
Mar 26, 2009
I've search around quite a bit, but I can't seem to find a clear answer.
I've turned on mod_status, and on the status page, I'm worried Apache is being overworked.
Code:
CPU Usage: u334.883 s94.5703 cu177.422 cs0 - 43.3% CPU load
54.1 requests/sec - 181.5 kB/second - 3435 B/request
178 requests currently being processed, 52 idle workers
__RKKK__K___KW_CKCKC_KC_KCK_KKCCK_K_KKWCKCCKCWKKKCRCKKKK._K_C__K
KK_K__K_K_KK_C_KKKKK_KKW.KRCKWKKW_CCKWKRK..___KKCKKKKKKKR_KKKW.W
_KK_____RKRC.KKCKCCRK__CK._KWCK_KKRCCK.C__CR.CWCCKCRKK.RR.K_CR_K
C_KW._._K.K..KKK_KRCCKWKK__..R.CRWCKK.KCK.K.KK_K....._...KK.....
......KC.CK...C...CK......W........C............................
................................................................
................................................................
................................................................
At the time I took this particular snapshot, it's not near its peak... it's not uncommon for the CPU load approach 60%. Reading around, it seems the CPU load should normally be under 1% (such as 0.0139% or what-not). Is this true?
The weird thing though... I have no idea where that number is coming from, because according to "top", the CPU is actually 90% idle.
Here is my Apache MPM settings:
Code:
ServerLimit 512
<IfModule mpm_prefork_module>
StartServers 10
MinSpareServers 15
MaxSpareServers 50
MaxClients 1024
MaxRequestsPerChild 0
</IfModule>
I actually just raised the MaxClients from 512 to 1024 because I was hitting a constant cap of 40 requests/sec... and I was worried it was going to bottleneck. When I raised that value, the max requests per second now seem to be freed up.
If the actual CPU of the server is 90% idle... am I okay? Anyone know where Apache's getting the CPU Load info from?
View 13 Replies
View Related
Apr 16, 2007
I have two servers, one for apache hosting a vbulletin forum, and another one for hosting its database.
Sometimes, I get very high load on the Apache server (>300) and the server stops responding. As a result, I have to stop apache in order to reduce the load and then start it again.
when I query the number of online users using this command:
Code:
netstat -an | grep : 80 | wc -l
I get about 1500 to 2000
but in the forum statistics, the number of online users is more than 5000. I already made sure that there are no DoS or DDoS attacks.
This is the specs of my apache server:
CPU: GenuineIntel Intel(R) Pentium(R) D CPU 3.40GHz
RAM: 2 GB
Server OS: CentOS 4.4
Apache Version: 1.3.37
and here is my httpd.conf:
Code:
ServerType standalone
Timeout 15
KeepAlive On
MaxKeepAliveRequests 200
KeepAliveTimeout 15
MinSpareServers 10
MaxSpareServers 15
StartServers 10
MaxClients 500
MaxRequestsPerChild 0
Is there anyway by which I can optimize my server for better performance and less load?
View 12 Replies
View Related
Mar 1, 2008
if anyone has had problems with high cpu load after upgrading APACHE to 2.2.8. We were running 1.3.5 with comfortable CPU loads of 2-10 on dual Xeon 2.8's. Now the loads are 20-70 with most of the CPU being used by many many httpd processes. I've heard that APACHE v2 does consume more resources, but am wondering if there was a problem with the build, or is it that much more demanding.
OTHER INFO:
WHM:11.15
CPANEL: 11.18
OS: CENTOS 4.6
KERNAL: 2.6.20.4-ts.grh.mh.i386
View 3 Replies
View Related
Feb 12, 2007
i'm hosting a forum (~80 simultalinous users online) In a VDS 512 MB RAM, Linux Debian with apache 1.3 and mysql 4.1 , php4.
Apache seems to be busy, pages don't even load, this can be resolved by restating apache. and after a couple of time (about 4 hours) it does the same thing again, and i do have to restart it again and looping ...
Here is my httpd.conf file :
Code:
Timeout 200
KeepAlive On
MaxKeepAliveRequests 200
KeepAliveTimeout 3
MinSpareServers 5
MaxSpareServers 15
StartServers 5
MaxClients 20
HostnameLookups Off
MaxRequestsPerChild 2000
View 14 Replies
View Related
Feb 11, 2013
I have complied Apache from the source with so enabled and compiled PHP with Apache apxs. What if I do, if I want to add/Load another modules as a dynamic modules without recompiling apache. Suppose if I want to enable rewrite or any other module.I am pasting the command which I used to compile apahce.
Apache
==
./configure --prefix=/usr/local/apache --enable-module=so
make
make install
PHP
==
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs
make
make install
Both are running fine on my server,how to enable mod rewrite module as shared module fro example ??
View 1 Replies
View Related
Oct 30, 2009
is there a way to automate apache restart when my server's load reached 5+ sever load?
View 8 Replies
View Related
Jul 29, 2008
We've a quadcore Xeon and start to have issues with its very high cpu load (which is made by apache & mysqld,).
So here is ps aux:
Code:
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 2040 620 ? Ss Jul13 0:13 init [3]
root 2 0.0 0.0 0 0 ? S Jul13 0:00 [migration/0]
root 3 0.0 0.0 0 0 ? SN Jul13 0:00 [ksoftirqd/0]
root 4 0.0 0.0 0 0 ? S Jul13 0:00 [watchdog/0]
root 5 0.0 0.0 0 0 ? S Jul13 0:00 [migration/1]
root 6 0.0 0.0 0 0 ? SN Jul13 0:00 [ksoftirqd/1]
root 7 0.0 0.0 0 0 ? S Jul13 0:00 [watchdog/1]
root 8 0.0 0.0 0 0 ? S Jul13 0:00 [migration/2]
root 9 0.0 0.0 0 0 ? SN Jul13 0:00 [ksoftirqd/2]
root 10 0.0 0.0 0 0 ? S Jul13 0:00 [watchdog/2]
root 11 0.0 0.0 0 0 ? S Jul13 0:00 [migration/3]
root 12 0.0 0.0 0 0 ? SN Jul13 0:00 [ksoftirqd/3]
root 13 0.0 0.0 0 0 ? S Jul13 0:00 [watchdog/3]
root 14 0.0 0.0 0 0 ? S< Jul13 0:00 [events/0]
root 15 0.0 0.0 0 0 ? S< Jul13 0:00 [events/1]
root 16 0.0 0.0 0 0 ? S< Jul13 0:00 [events/2]
root 17 0.0 0.0 0 0 ? S< Jul13 0:00 [events/3]
root 18 0.0 0.0 0 0 ? S< Jul13 0:00 [khelper]
root 19 0.0 0.0 0 0 ? S< Jul13 0:00 [kthread]
root 25 0.0 0.0 0 0 ? S< Jul13 0:01 [kblockd/0]
root 26 0.0 0.0 0 0 ? S< Jul13 0:01 [kblockd/1]
root 27 0.0 0.0 0 0 ? S< Jul13 0:01 [kblockd/2]
root 28 0.0 0.0 0 0 ? S< Jul13 0:03 [kblockd/3]
root 29 0.0 0.0 0 0 ? S< Jul13 0:00 [kacpid]
root 122 0.0 0.0 0 0 ? S< Jul13 0:00 [cqueue/0]
root 123 0.0 0.0 0 0 ? S< Jul13 0:00 [cqueue/1]
root 124 0.0 0.0 0 0 ? S< Jul13 0:00 [cqueue/2]
root 125 0.0 0.0 0 0 ? S< Jul13 0:00 [cqueue/3]
root 128 0.0 0.0 0 0 ? S< Jul13 0:00 [khubd]
root 130 0.0 0.0 0 0 ? S< Jul13 0:00 [kseriod]
root 205 0.0 0.0 0 0 ? S Jul13 0:46 [pdflush]
root 207 0.0 0.0 0 0 ? S< Jul13 0:43 [kswapd0]
root 208 0.0 0.0 0 0 ? S< Jul13 0:00 [aio/0]
root 209 0.0 0.0 0 0 ? S< Jul13 0:00 [aio/1]
root 210 0.0 0.0 0 0 ? S< Jul13 0:00 [aio/2]
root 211 0.0 0.0 0 0 ? S< Jul13 0:00 [aio/3]
root 383 0.0 0.0 0 0 ? S< Jul13 0:00 [kpsmoused]
root 433 0.0 0.0 0 0 ? S< Jul13 0:00 [ata/0]
root 434 0.0 0.0 0 0 ? S< Jul13 0:00 [ata/1]
root 435 0.0 0.0 0 0 ? S< Jul13 0:00 [ata/2]
root 436 0.0 0.0 0 0 ? S< Jul13 0:00 [ata/3]
root 437 0.0 0.0 0 0 ? S< Jul13 0:00 [ata_aux]
root 443 0.0 0.0 0 0 ? S< Jul13 0:00 [scsi_eh_0]
root 444 0.0 0.0 0 0 ? S< Jul13 0:00 [scsi_eh_1]...
They don't appear for some time if I kill them (a day or more). But it repeats again and again. One day there were 8 similar processes in total in max which used all 4 cores at 100% (and even ssh console was extremely slow to do something there).
I think that somebody is trying to make a small attack of some sort but I need to check it first. I tried to look at apache logs but there were too many posting requests from different IPs and no dublicates for little period of time so I had no success.
Anyway, that script worked for us for 4 years already and we didn't have any problems with it even on our old single core P4 2.8 ghz.
way to make sure is this an attack of some sort or just this script doesn't work correctly on our new machine?
Are there any ways to get IPs of visitors who are running posting.php with CPU overloading?
View 5 Replies
View Related
Sep 10, 2008
been checking out this site for a while and finally decided to register because I have a problem. Also hope this is the correct forum for this topic, sorry if it isn't.
So I have a problem with Apache. One of the sites that I run/host has a moderately large vBulletin board, and Apache just seems to eat up the CPU. Load averages have shot up between 20-30 and I've seen it as high as 80. Apache and MySQL are optimized already, I'm using suPHP for security because there are other sites on this box.
The funny thing about this is that it only started happening about a week ago. After checking for rootkits and all that garbage, I reinstalled the OS just to be on the safe side. Everything comes back clean still. I also got fed up and hired Platinum Server Management for a month, to see if they could find a solution (and I've been interested in reselling their services, but that's not relevant). So far the only thing they can come up with is disable suPHP, which isn't an option. I do realize that suPHP is ~20-25 times slower than mod_php, but what totally baffles me is that it worked beforehand and started going all crazy like this. I did try running the site using an dso configuration, the load did drop, but nothing to be proud of.
This site, and the server overall hasn't had any increase in load, I've held off putting new accounts on it until I get this fixed.
In the meantime, I have said forums running on lighttpd, which lowered the load. (Also writing a tutorial on having lighty work with cPanel)
View 6 Replies
View Related
Jan 22, 2007
write a cronjob so that apache will restart when the server reaches a load of 20.
View 13 Replies
View Related
May 30, 2013
I have a setup where Apache connects to a F5 load balancer which in turn balances between two jboss app servers.
Apache using mod_proxy -> F5 (hardware load balancer) -> 2 jboss application server
It uses jsessionid. I sometimes get 500 errors for the post methods. I think the request goes to the incorrect jboss server because of the F5 load balancer. Everything works just right when I shutdown one of the jboss app servers.
View 1 Replies
View Related
Oct 10, 2009
We want to implementing the load balancing for our domain, if the traffic is heavy and 8080 (i.e. currently integrated with apache) doesn''t serve more that time the apache will call 8081 and serve to the request without any problem.
We want to access our site www.domain.com (i.e. run on port 80). Please guide us it is possible or not?
View 2 Replies
View Related
Jun 21, 2008
if it was possible to load vhosts from a MySQL database and the only solutions i found didnt work for me. Im running Apache on Windows. Has anyone seen anything that would work with Windows? The only alternative i can think of is to read the database info using PHP and output it to a vhosts config file. I dont want to do that though because it means restarting the server to load the new config and i hear that a lot of vhosts slows the server down
View 4 Replies
View Related
Apr 24, 2007
I have 2 almost similar webservers:
debian 3.2, P4 3GHZ, 1 Gb ram, kernel 2.6, apache2, php4
Initial apache2.conf:
Code:
Timeout 4
KeepAlive Off
KeepAliveTimeout 2
ServerLimit 1500
<IfModule prefork.c>
StartServers 10
MinSpareServers 10
MaxSpareServers 15
MaxClients 1500
MaxRequestsPerChild 3000
</IfModule>
I update the sources.list on server 1 to mirrors of the new debian 4 etc . I run apt-get update and apt-get dist-upgrade . A whole bunch of things get updated (it was long time ago that I did this anyway). After some troubles with /boot/grub/menu.lst the server boots ok, and everything is well. This server used to have loads of 15-25 at peak times, but after the update its running very smooth with loads of 2-3 at the same peak times. I dont know why exactly, as I noticed updates in OS , kernel version (from 2.6.8x to 2.6.18) , apache2 , php (4.4.4-8+etch1) , and I also needed to update eaccelerator from 0.94 to 0.95 .
A few days later I update server 2. Everything seems to go the same, although the kernel version stays at 2.6.8-3-686. I dont think kernel version at start was exactly same at server 1. But the new php version is the same as server 1, and everything else looks the same too.
But when peak times are coming up, this server starts to have troubles. It is quickly rising to total of 200-300 processes , while server 1 always stays stable at 60-70.
Server 2 also reacts slow if I click somewhere on the site. It takes 5-10 seconds to show a new page. However the load stays pretty low at 1-2 . I see no big cpu usage and also no big memory usage. I have the impression that this server 2 is somehow wasting a lot of apache processes and is making things hard for itself without a real reason.
When I check the seperate mysql database server, I also notice a lot of processes.
Around 200-250 whereas it used to be 40-60. Sometimes this adds up so hard, that all webservers are blocked because mysql has too much processes. When I check the mysql connections, I see a few dozen things like 'unauthen ip:port Connect login' just hanging. All of them have the ip of webserver 2. Those extra apache processes are somehow hanging on to the mysql server without really doing something.
I dont know what is happening, but this server is underperforming very badly now. I managed to limit the problem by drastically lowering ServerLimit and MaxClients on webserver 2 , but this is no real solution. The server is still slow, at least now its not bringing down the others.
My question : what should I check for now ? I noticed a different structure in the conf files in debian etch, maybe something new has a bad influence on my old conf files? Is there something wrong with the combination of kernel+php version? I have no idea, please point me in the right direction so I can learn from this.
View 4 Replies
View Related
Sep 2, 2007
I deal with a server that gets positivey slammed once a week for a few months per year. I'd tell you how many hits we got tonight, but I'm still waiting for AWSTATS to chew through the 2gb access_log file...
Tonight, I made some changes that SEEM to work, but I"mn not sure what the long-term effects could be. If we have any apache experts on the forums, I'd really like to bend your ear for a few to see what you know.
Obviously, with PHP, we're limited to prefork MPM.
First of all, I dropped Timeout from 300 to 120. That should be MORE than enough time to know that we've timed out. Then I dropped KeepAliveTimeout to 5 from 15.
Here's the radical one. Watching the process list and the load, it seemed that load spiked when the processes hit their end of useful life and respawned. Duh. This was happening every four seconds at the load we were under. MaxRequestsPerChild was set to 10,000. I upped this to 80,000 over a period of hours that we were under the load. I didn't see any significant memory leakage, but it's the change I'm worried about the most. I've seen Apache do some bad things when people allow this to go unlimited, and had always used the relatively low default as a guide.
Besides not loading a bunch of dynamic modules (also done, I usually do this so I'm not worried about it), what else can I do tuning-wise to keep load down? Please note that caching and load-balancing aren't acceptable solutions; I have one server to work with (for now) and the boss says no to caching because of how frequently our information updates. We also have extensive .htaccess files, so there's no LHTTPD in my future.
View 2 Replies
View Related
Apr 2, 2015
I am completely new to apache and I had the load balancer set up for a single domain that was working perfectly fine, but when it came to multiple domains i couldn't, for the life of me, figure out what to do.
There is example.com sub.example.com and otherexample.com
I had a single node set up for this but I want to experiment with the balancer. I have scratched Google and I only found broken info which couldn't explain much to me. Here are my domains
<VirtualHost *:80>
DocumentRoot "/var/www/domain.com"
ServerName domain.com
</VirtualHost>
[Code] ....
Any example configuration of the default file.
View 1 Replies
View Related
Mar 1, 2013
I am using Apache 2.2.22 on Windows Server 2003 64 Bit, using PHP 5.2.17. System Specs are 4 x 2.0 Ghz processor, 4 GB of Ram.
I'm noticing when I load my website [URL] .... there is about a 2000ms delay before the page starts to load.
How can I make Apache load faster?
View 1 Replies
View Related
Jul 30, 2014
I've updated to Apache 2.4.10 from 2.4.9 and all of a sudden my pages don't load anymore.Previously I had this issue rarely and closing the PHP-cgi.exe processes fixed it.But since the update the issue happens almost constantly.
View 17 Replies
View Related
Oct 23, 2013
have a website that sources a number of jquery plugins, when I load the site in chrome or firefox the javascript console is saying that these files were not loaded.
The server is a localhost and the files are local.
The google jquery file loads fine.
how I need to configure the apache config file to deal with javascript.
View 2 Replies
View Related
Jun 26, 2013
I'm running a WAMP server, hosting an internal website for my company's use.
Windows XP Home SP3
Apache 2.0
MySQL Server 5.5
PHP 5.?
Last night Microsoft Security Essentials froze while running a scan. I restarted the scan and it froze again, so I rebooted the server. Now Apache won't start, providing the following error ....
View 4 Replies
View Related
Oct 3, 2013
We are using 4 apache and 8 weblogic.When little high load is coming on application (say 300 users), we are getting non-http response code (Non HTTP response code: org.apache.http.conn.HttpHostConnectException).And also all the load is generated from one single IP address.And we are using apache 2.2.
View 1 Replies
View Related