Apache KeepAlive On Or Off?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 247mg
    Yellowplum / 247mg
    • Feb 2008
    • 2162

    #1

    Tech 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
    247mg.com - Indian Affiliate Program - Over 50+ Sites To Promote - Monetize Your INDIAN Traffic Today!
  • Klen
    • Aug 2006
    • 32235

    #2
    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.

    Comment

    • Brian mike
      #Alberta51
      • Oct 2014
      • 8735

      #3
      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 ..
      Tube - Cam - Escorts - Top List
      Menu Tab - Banner - Header Link - Blog Post
      DM me

      Comment

      • Ferus
        Bye - Left to do stuff
        • Feb 2013
        • 4108

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

        Comment

        • 247mg
          Yellowplum / 247mg
          • Feb 2008
          • 2162

          #5
          Originally posted by Ferus
          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....
          247mg.com - Indian Affiliate Program - Over 50+ Sites To Promote - Monetize Your INDIAN Traffic Today!

          Comment

          • freecartoonporn
            Confirmed User
            • Jan 2012
            • 7683

            #6
            Originally posted by 247mg
            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.
            SSD Cloud Server, VPS Server, Simple Cloud Hosting | DigitalOcean

            Comment

            • Ferus
              Bye - Left to do stuff
              • Feb 2013
              • 4108

              #7
              Originally posted by freecartoonporn
              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

              Comment

              • 247mg
                Yellowplum / 247mg
                • Feb 2008
                • 2162

                #8
                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
                247mg.com - Indian Affiliate Program - Over 50+ Sites To Promote - Monetize Your INDIAN Traffic Today!

                Comment

                • Ferus
                  Bye - Left to do stuff
                  • Feb 2013
                  • 4108

                  #9
                  Try to set KeepAliveTimeout to one or two

                  Comment

                  • freecartoonporn
                    Confirmed User
                    • Jan 2012
                    • 7683

                    #10
                    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
                    SSD Cloud Server, VPS Server, Simple Cloud Hosting | DigitalOcean

                    Comment

                    • iceboi
                      Confirmed User
                      • Oct 2017
                      • 302

                      #11
                      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.
                      Highest CPM pop-under |
                      Best Converting Modern Cam Site

                      Comment

                      • freecartoonporn
                        Confirmed User
                        • Jan 2012
                        • 7683

                        #12
                        use gtmetrix
                        check page load time.
                        set that value as keep alive value.
                        SSD Cloud Server, VPS Server, Simple Cloud Hosting | DigitalOcean

                        Comment

                        • Major (Tom)
                          So Fucking Banned
                          • Nov 2003
                          • 32492

                          #13
                          Originally posted by 247mg
                          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

                          Comment

                          • 247mg
                            Yellowplum / 247mg
                            • Feb 2008
                            • 2162

                            #14
                            Host has detected RAID issue and changed. A brand new card was put in. The issue persists and raid issue.
                            247mg.com - Indian Affiliate Program - Over 50+ Sites To Promote - Monetize Your INDIAN Traffic Today!

                            Comment

                            • Major (Tom)
                              So Fucking Banned
                              • Nov 2003
                              • 32492

                              #15
                              Originally posted by 247mg
                              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.

                              Comment

                              • NatalieMojoHost
                                Confirmed User
                                • Aug 2013
                                • 1479

                                #16
                                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.

                                MojoHost.COM | natalie at mojohost dot com | Skype natalie.ac | Telegram @znatalie. Since 1999: 70 Adult Industry awards for Best Hosting Company and professional excellence.

                                Comment

                                • 247mg
                                  Yellowplum / 247mg
                                  • Feb 2008
                                  • 2162

                                  #17
                                  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
                                  247mg.com - Indian Affiliate Program - Over 50+ Sites To Promote - Monetize Your INDIAN Traffic Today!

                                  Comment

                                  Working...