Trade-helper causing problems

Monday 2nd February, 2015 · Posted by Roguey · Comment 13 comments

Last night you may of noticed that the whole of the Elite & Dangerous was shutdown. The reason was that the hoster was finding the server was being overloaded. After knowing about the issue I took a copy of the database/code to my own server, so I could I work-out what was happening. After an hour or so I traced the problem to an SQL query in the Trade-helper.

The problem was that the more data that was imputed, the larger the query got. This query grew so large, it was taking upto 30+ seconds to complete. However the problem grew, with multiple queries being ran - so the slower the site became, eventually grinding to a halt.

So last night I re-built the code for the trade-helper mk1 and mk2. Some of the queries which took 30+ seconds now are complete in 0.3 second or less (around x100 faster or more). Instead of one large query, I now use multiple queries (with a form of caching).

After a few emails the host re-enabled the Elite & Dangerous section but disabled the trade-helper. I am in the process of testing the new trade-helper code to make sure it doesnt happen again however it looks positive at the moment.

I hold my hands up on this one, it was my fault. Dont always think that less queries are better. Hopefully it will be back shortly.

Comments

Avatar To post comments you need to register and log-in.
⇊ Load more comments ⇊