Attack of the 503 errors

Started by Foster Grant, December 09, 2011, 05:13:37 AM

Previous topic - Next topic

Foster Grant

We've been getting lots of these stupid errors for our forum, which is running SMF 1.1.15. About a month ago, our webhost ... Siteground (we're on a shared server due to budget constraints) ... sent a letter to the registered owner of our forum as follows:

Quote from: Dimitar at SitegroundDear ***,

With this notification we would like to inform you that your account {site snipped} consumes a very high percentage of the server resources and thus affects the performance of the whole shared server.

In order to maintain the stability of the server, we had to temporarily limit the shared server resources your account can use. Please note that this may result in occasional "Resource temporary unavailable" error messages shown on your website.

We are very much aware of the inconvenience this issue may cause you, so we would like to take a moment and explain the reasons for our actions: as you know, your account is hosted on a shared hosting server and thus sharing the resources of the server with other customers' accounts. Even though our shared servers are well optimized, the nature of the shared server is such that no matter how powerful or how well optimized the machine is, it is possible that one user and even one application consumes most of the server resources and overloads the machine. Thus all other accounts on the server stop responding and become inaccessible.

In order to prevent server overload, the source of the high load has to be isolated so that it cannot affect the overall server performance. This is a standard procedure used by all shared hosting providers.

We have conducted a detailed investigation of the reasons for the high resource consumption and it turned out that a script executes slow queries towards its database, which eventually hogs the server. The server tries to execute your slow queries while putting other processes in the queue until some memory is freed. While they are waiting however, they stack up and cause further problems.

We believe you are not causing high server load intentionally and we will do our best to assist you so that your site can be fully functional again as soon as possible.

As mentioned before, the problem is caused by slow queries executed towards your application's database. There can be many reasons for slow database queries, but the following 3 are the most common ones:

1. Large database
2. Not well written scripts
3. Large number of internal links that query the database directly.

Here are some of the database queries that are slow and consume a lot of server resources:

        Executed 4 min ago for 2 sec on Database --> thespor3_smf1.                                                                                         
        SELECT ID_MSG, ID_MEMBER FROM smf_messages WHERE ID_TOPIC = 3721 ORDER BY ID_MSG LIMIT 550, 25                                                     
        Executed 1 min ago for 4 sec on Database --> thespor3_smf1.                                                                                         
        INSERT IGNORE INTO smf_sessions (session_id, data, last_update) VALUES ('u0j4aueplllue1bg3ouenhk1b6', 'rand_code|s:32:\"397ca7f2efa93646f8bd7e547a433596\";ban|a:5:{s:12:\"last_checked\";i:1320954251                                                                                                           
        Executed 1 min ago for 3 sec on Database --> thespor3_smf1.                                                                                         
        INSERT IGNORE INTO smf_log_online (session, ID_MEMBER, logTime, ip, url) VALUES ('ip65.52.104.88', 0, NOW(), IFNULL(INET_ATON('65.52.104.88'), 0), 'a:3:{s:5:\"topic\";i:79                                                                                                                                     
        Executed 1 min ago for 2 sec on Database --> thespor3_smf1.                                                                                         
        SELECT ID_MSG, ID_MEMBER FROM smf_messages WHERE ID_TOPIC = 79 ORDER BY ID_MSG DESC LIMIT 379, 25                                                   
        Executed 1 min ago for 2 sec on Database --> thespor3_smf1.                                                                                         
        SELECT ID_MSG, ID_MEMBER FROM smf_messages WHERE ID_TOPIC = 3633 ORDER BY ID_MSG DESC LIMIT 587, 25


=====> Databases owned by ********.
Databases found:
        *******_smf1 196Mb.

From the queries above we can conclude that your issue is caused by not well written scripts. In order to have the limitations removed, you should optimize your script so that it consumes less server resources.

Having not well written scripts is a quite complex problem. It may be caused by an additionally installed extension/module that is not working properly, or it may be in the application itself.

If the reason is in an extension/module, the easiest solution would be to disable/remove it. This can usually be done from the application's admin area.

Please disable the script that is using the queries above to resolve the issue.

If the problem is in the application itself, solving it may take much more time and effort and will probably require advanced programming skills. In such cases it would be best to contact the application's developers and ask for further assistance. They should be able to examine the issue and offer a suitable solution for it.

There are some general things you can do to optimize your site (such as enable cache). More information on how to optimize your site can be found in our Website Performance Tutorial (hxxp:www.siteground.com/tutorials/websiteperformance/index.htm). [nonactive]

If optimizing the application is not a suitable option for you, we can offer you one of our dedicated solutions (hxxp:www.siteground.com/dedicated_solutions.htm [nonactive]) as an alternative. There all of the system's resources will be dedicated to your account and using a more resource-demanding application will not be a problem.

SiteGround is experienced in providing dedicated hosting solutions and we are happy to inform you that as an existing and loyal SiteGround customer, we will offer you a beneficial upgrade package including:

-No set up fees
-Free website content transfer from the shared server to the dedicated machine
-No website downtime during the upgrade

The upgrade process is simple and straightforward and you can order your dedicated solution upgrade immediately. To do that, please log in your SiteGround User Area -> Order section-> Upgrade to Dedicated Solution option.

If the problem with your application is not resolved in 7 days, we will be forced to take further actions in order to ensure the stability of the shared server.

Thank you in advance for your understanding and cooperation!

Please do NOT reply to this email. You can add comments on this issue by logging to your Customer Area (hxxp:www.siteground.com/login_page.htm [nonactive]) and comment the ticket that has been automatically open on your behalf in connection to this case.

In looking at our traffic levels, I'm not sure why we're causing them such problems. Of course, I could be a complete idiot but it seems like an average of less than 15,000 page views per day shouldn't be that much of a load. We're not running any extra services beyond the HTTP services and the SMF install.

I guess what I really want to know is this: Is there something wrong with the PHP commands "Dimitar" is blaming? Is this something where an upgrade to 2.0.x fixes the problem? Am I underestimating how much of a hit we're putting on the server?

Or is it what we are kind of leaning toward — Siteground is shaking us down for more money?

kat


Illori

also you do have an oversold host, unlimited does not exist. many oversellers are known for telling their users that they are using more then they can have and want to upgrade them, where moving to a real host that does not oversell is a better option and you get better performance overall.

Foster Grant

Quote from: K@ on December 09, 2011, 06:41:47 AM
BIG question...



Active mods:

Stars and Badges 2.1
Stop Forum Spam 0.9
Ignore Another User 1.1

There's also a handful of SMF update packages: 1.0.21 / 1.1.13 Update, SMF 1.1.14 Update, SMF 1.1.15 Update. Each are listed as version 1.0.

I parked a couple of mods to see if that might somehow clear things up, but I've since decided that neither YouTube BBcode 2.6 nor Footnotes 1.08 have anything to do with the problem.

Current theme is Babylon. No calendars, no arcades, nothing like that.

Sir Osis of Liver


Check your server traffic stats - look for unusual number of hits on specific files.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Advertisement: