GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Tech Apache KeepAlive On Or Off? (https://gfy.com/showthread.php?t=1319149)

247mg 10-30-2019 04:39 PM

Apache KeepAlive On Or Off?
 
We are facing a very strange issue... server keep timeout randomly. Host is saying to turn off Apache keepalive. What high traffic sites do turnoff or turn on.... please advice

thanks

Klen 10-31-2019 04:02 AM

There is no universal solution, you simply need to try both and see what happens. Ir problem persist even after you do it, it means problem lies somewhere else.

Brian mike 10-31-2019 04:14 AM

Which hosting is that ?

Guessing Disk failure/ corrupt ? Thinking out load :)
I can refered you to a top Tech that know his shit around at raisonable rates. ( depending of the issue )
PM me if you want his contact he his a GFY Member and I sleep WELL the Last couple monthsssss ..

Ferus 10-31-2019 04:18 AM

What does the logfil say? Any unexpexted service-terminations or does the session just timeout with no error code?

247mg 10-31-2019 12:00 PM

Quote:

Originally Posted by Ferus (Post 22552736)
What does the logfil say? Any unexpexted service-terminations or does the session just timeout with no error code?

Just getting Random time out.. Host has finally found some hardware issue in RAID let see... but they keep asking to try KeepAlive Off and see... what is difference between alive on and off....

freecartoonporn 10-31-2019 01:31 PM

Quote:

Originally Posted by 247mg (Post 22553005)
Just getting Random time out.. Host has finally found some hardware issue in RAID let see... but they keep asking to try KeepAlive Off and see... what is difference between alive on and off....

alive on, keeps connection on for few more seconds so that client can fetch more files/data using same connection and doesnt have to start new connection as there is limit in apache to max number of concurrent connections.

alive off, closes the connection as sooon as data is transmitted. so every new file load needs to start new connection, this reaches the apache max number of concurrent connections pretty fast.

you have to find sweet spot and define keepalive time in seconds if thats possible.

if you have too many files linked from single page, then keep alive on
else keep alive off.

my suggestion, hire someone talented and move everything to nginx.

or use cdn to serve files., so only data fetched from DB is used by apache connections.

Ferus 10-31-2019 01:42 PM

Quote:

Originally Posted by freecartoonporn (Post 22553071)
my suggestion, hire someone talented


that


If it's a busy server, and if isent use all of the RAM, I see no reason to turn it off, unless there is shitty code or a bad firewall/loadbalancer/cache in front.

You could set KeepAliveTimeout to 1 or 2 seconds, to test if it made a difference, but I would not turn it off

247mg 10-31-2019 03:10 PM

We tried KeepAlive Off and all hanged and gone down and we have to switch back to KeepAlive On.

Its NATS server and track incoming hits and write to database only. Traffic comes in to site with nats affiliate code via link domain and redirect to different server with content in it. Once user click on any gallery its goes back to nats code and nats track hits and write to database and track it.

The time out comes in betweek nats code link and redirect domain

secure.abc.com redirect to tour.abc.com

secure.abc.com is nats server and tour.abc.com is different.

If we access direct secure.abc.com instead of redirect its give time out.... this is the issue

Ferus 10-31-2019 03:21 PM

Try to set KeepAliveTimeout to one or two

freecartoonporn 10-31-2019 03:24 PM

ref :
https://serverfault.com/questions/55...traffic-server
https://httpd.apache.org/docs/2.4/misc/perf-tuning.html

Max clients 7500
Max Requests per Child 100
Keep-Alive Timeout 5
Max Keep Alive requests 768
Timeout 30

theres no single solution fits all, so you gotta try changing Keep-Alive Timeout value. and set to which works best. keep eye on logs.

read this : https://bobcares.com/blog/speed-up-apache/

and this : https://www.linode.com/docs/web-serv...apache-server/

and this : https://medium.com/@sbuckpesch/apach...e-1bfecf161534

nginx uses workers too, so that might solve your issue, switching to workers mpm

iceboi 10-31-2019 09:44 PM

In my experience,it's safe to turn off keepalive if your site isn't loading tons of stuff dynamically(API requests). If your frontend is mostly static, then keeping the connection to the server is overkill and will use alot of memory, especially with Apache.

If you still want keepalive on, set the timeout value lower to reduce the number of simultaneous connections to your server.But a low timeout would negate the reason why keepalive is beneficial so it's best to turn it off.

Eg: if you set the timeout to 30 seconds, it would mean that if the user spends more than 30 seconds on your page,he wouldn't have benefited from keepalive but having it on would use extra resources on your server...even though the user doesn't benefit.

freecartoonporn 10-31-2019 10:38 PM

use gtmetrix
check page load time.
set that value as keep alive value.

Major (Tom) 11-01-2019 12:09 AM

Quote:

Originally Posted by 247mg (Post 22552573)
We are facing a very strange issue... server keep timeout randomly. Host is saying to turn off Apache keepalive. What high traffic sites do turnoff or turn on.... please advice

thanks

Nathan Phillips may be able to help

247mg 11-01-2019 06:17 AM

Host has detected RAID issue and changed. A brand new card was put in. The issue persists and raid issue. :(

Major (Tom) 11-01-2019 06:26 AM

Quote:

Originally Posted by 247mg (Post 22553389)
Host has detected RAID issue and changed. A brand new card was put in. The issue persists and raid issue. :(

Replace it with the same exact card and firmware.

NatalieMojoHost 11-01-2019 08:00 AM

The rule of thumb is to have keepalive on unless the server is low on RAM. For busy databases, definitely have it on and consider upgrading RAM. The issue you're describing seems more than just Apache config.

247mg 11-01-2019 08:33 AM

Its E5 server with 64GB... only got NATS and it’s database in it.. waiting for peak traffic time to hit the server to see more ram effect... before its 32gb


All times are GMT -7. The time now is 03:07 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123