E2 lag problems and (potential) solutionsCheck out the Database Lag-o-meterThe Nefarious Everything2 Lag has several potential causes: The E2 MySql database seems to have an upper limit of ~300 queries/second, at least for the type of queries which we do. When queries are sent which take a large amount of sorting or handle large amounts of data (ie doing a user search on pseudo_intellectual) it takes longer than the 0.003 seconds each query is "allowed" - this means everyone else has to wait.
E2's web server currently runs 60 Apaches. That's roughly how many simultaineous connections it can handle. When request #61 comes in, it has to wait until there is one available to process the request. This is what causes the most severe lag (>30s pageloads), and can be triggered by database saturation as each process blocks until it's db transactions are complete.
One perl script written without any sleep()s in it can
take up more resources than 100 normal users. They can be
auto-noders, auto-linkers, personal statistics managers, chatter-bots, etc etc. Also, a wide array of data-harvester bots have visited us, and the only one allowed to stay is Google's. Once detected, they're fairly easy
to weed out -- via IP's, User Agents, query patterns, etc -- but until then they can ruin the party.
Please, if you write bots, join Edev and try to make them as friendly to the system as possible. Use generous sleep()s, use the XML interface, and the bot will play nice and you (and others who use your 'ware) won't get your IP logged and banned.
At roughly 7am server time, E2 begins purging nodes marked for death on node row. Deleting nodes is an expensive process, partly because of the table locking, and because of the softlink work required. The server's just going to be slower at that time, despite the fact that it's serving < 1/4 of the traffic during peak hours.
Everything2 is trying to handle it's growth as best as we can with the resources we have. Emailing me saying "The lag is really bad" helps zilch, because I KNOW -- I'm sitting with a term open on the server watching the train wreck. If you're a mod_perl or MySql guru and know some tricks which can save us CPU cycles, please post on Edev, or msg me. assuming, of course, you can get the page to load
|
| This affordable entertainment brought to you by The Everything Development Company |