ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    My server is crashing, I think its due to traffic but I am not sure how to tell

    IT Discussion
    5
    50
    6.7k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • IRJI
      IRJ
      last edited by

      My new website has 50,000 views in the first 2 weeks and I have had a couple server crashes. We are getting hit especially hard today with traffic. The crashes are corresponding to when traffic is the highest.

      When the server crashes are happening " There is an error connecting to the Database" Once I reboot everything is fine and dandy. I have had to do this several times today.

      1 Reply Last reply Reply Quote 0
      • scottalanmillerS
        scottalanmiller
        last edited by

        What OS are you running? What are the server specs? 50K in two weeks is not that much for a web server. It should be able to handle that pretty well even with tiny resources. What platform is the website running on? What database do you have?

        IRJI 1 Reply Last reply Reply Quote 0
        • IRJI
          IRJ @scottalanmiller
          last edited by

          @scottalanmiller said:

          What OS are you running? What are the server specs? 50K in two weeks is not that much for a web server. It should be able to handle that pretty well even with tiny resources. What platform is the website running on? What database do you have?

          0_1452539509299_2016-01-11_14-11-32.jpg

          1 Reply Last reply Reply Quote 0
          • scottalanmillerS
            scottalanmiller
            last edited by

            1GB of RAM is not much for a web server and the database on the same box. Should be okay if tuned, but it does put you as running pretty lean.

            What does SAR tell us about CPU and memory just before the crash(es)?

            IRJI 1 Reply Last reply Reply Quote 0
            • scottalanmillerS
              scottalanmiller
              last edited by

              Any reason you chose to run on such an old version of Ubuntu? Should be fine, but 15.10 is current. Each release typically brings more performance and stability, both things that matter for web hosting. Especially as the database and PHP layers tend to get updated as well.

              1 Reply Last reply Reply Quote 0
              • M
                marcinozga
                last edited by

                Is traffic mostly anonymous users? Or authenticated? If anonymous, install some caching plugins for that Wordpress. If people are logging in, you will probably need memcache and apc.

                IRJI 1 Reply Last reply Reply Quote 0
                • IRJI
                  IRJ @scottalanmiller
                  last edited by

                  @scottalanmiller said:

                  1GB of RAM is not much for a web server and the database on the same box. Should be okay if tuned, but it does put you as running pretty lean.

                  What does SAR tell us about CPU and memory just before the crash(es)?

                  0_1452539689892_2016-01-11_14-14-35.jpg

                  A 1 Reply Last reply Reply Quote 0
                  • scottalanmillerS
                    scottalanmiller
                    last edited by

                    What about sar -r?

                    IRJI 1 Reply Last reply Reply Quote 0
                    • IRJI
                      IRJ @scottalanmiller
                      last edited by

                      @scottalanmiller said:

                      What about sar -r?

                      I am unfamiliar with that command. How do I run it?

                      scottalanmillerS 1 Reply Last reply Reply Quote 0
                      • scottalanmillerS
                        scottalanmiller @IRJ
                        last edited by

                        @IRJ said:

                        @scottalanmiller said:

                        What about sar -r?

                        I am unfamiliar with that command. How do I run it?

                        If it is installed, exactly as I wrote it. If you have not installed it yet get it installed straight away. It's the most important troubleshooting tool on Linux. You use it for everything. Also the most important capacity planning tool. Only thing that collects your performance info and stores it.

                        apt-get install sysstat
                        
                        1 Reply Last reply Reply Quote 1
                        • IRJI
                          IRJ
                          last edited by

                          @scottalanmiller

                          0_1452539963621_2016-01-11_14-18-38.jpg

                          scottalanmillerS 1 Reply Last reply Reply Quote 0
                          • M
                            marcinozga
                            last edited by

                            Run sar -r 1

                            1 Reply Last reply Reply Quote 0
                            • IRJI
                              IRJ @marcinozga
                              last edited by

                              @marcinozga said:

                              Is traffic mostly anonymous users? Or authenticated? If anonymous, install some caching plugins for that Wordpress. If people are logging in, you will probably need memcache and apc.

                              I am using cloudflare for caching which is helping alot. Is there anything else I can do on top of that?

                              scottalanmillerS 1 Reply Last reply Reply Quote 0
                              • IRJI
                                IRJ
                                last edited by

                                0_1452540099011_2016-01-11_14-21-26.jpg

                                A 1 Reply Last reply Reply Quote 0
                                • M
                                  marcinozga
                                  last edited by

                                  W3 Total Cache or WP Super Cache will cache your pages as static files. No php or database queries will be fired when somebody visits your site.

                                  1 Reply Last reply Reply Quote 0
                                  • scottalanmillerS
                                    scottalanmiller @IRJ
                                    last edited by

                                    @IRJ it's too late to diagnose your issues now, sysstat has to be there and enabled (an extra step that only Ubuntu requires, heaven only knows why they make things so hard) BEFORE you have a crash. So we need to enable it and then wait for the next crash to see if you ran out of memory just before it went down or to get a decent idea of what had happened.

                                    1 Reply Last reply Reply Quote 0
                                    • scottalanmillerS
                                      scottalanmiller @IRJ
                                      last edited by

                                      @IRJ said:

                                      @marcinozga said:

                                      Is traffic mostly anonymous users? Or authenticated? If anonymous, install some caching plugins for that Wordpress. If people are logging in, you will probably need memcache and apc.

                                      I am using cloudflare for caching which is helping alot. Is there anything else I can do on top of that?

                                      Oh yes, that is only a very first step. You want a local cache as well. CF can only offload so much.

                                      1 Reply Last reply Reply Quote 1
                                      • scottalanmillerS
                                        scottalanmiller
                                        last edited by

                                        You can also consider static pages generated from WordPress. It is basically a manual full site cache. No active database connection needed and the speed goes way up. Faster and more reliable, but more work.

                                        stacksofplatesS 1 Reply Last reply Reply Quote 1
                                        • M
                                          marcinozga
                                          last edited by

                                          https://support.cloudflare.com/hc/en-us/articles/200169546-What-fields-do-I-need-to-enter-in-W3TC-W3-Total-Cache-settings-
                                          here's instruction how to setup W3 Total Cache plugin with Cloudflare.

                                          1 Reply Last reply Reply Quote 2
                                          • stacksofplatesS
                                            stacksofplates @scottalanmiller
                                            last edited by

                                            @scottalanmiller said:

                                            You can also consider static pages generated from WordPress. It is basically a manual full site cache. No active database connection needed and the speed goes way up. Faster and more reliable, but more work.

                                            Right. I don't know how WP does this, but Drupal has a module where you pretty much install it and then just tell it which pages you want stored as HTML when people are anonymous.

                                            scottalanmillerS M 2 Replies Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 3
                                            • 2 / 3
                                            • First post
                                              Last post