Fatal error with topic review fixed.
Some of you may have seen this error pop up when replying to topics:
Fatal error: Maximum execution time of 1 second exceeded in /home/admin/domains/warez-bb.org/public_html/includes/topic_review.php on line 213
As you can see, we have a maximum execution time of 1 second. This means that the execution of the PHP script will end after 1 second. This is a fair value because if any page cannot generate within 1 second, it usually will slow the server/site down. Our mistake was that this maximum execution time was initially set at 10 seconds and as you could imagine, it caused quite a lot of load on our servers. So yesterday, we decreased the maximum execution time to 1 second.
However, another problem occurred, there was a substantial increase in the number of errors above. It even prompted a topic in the Forum Comments section. Clearly something had to be done to fix it.
Through more investigation, we found out that the reason why this was occurring was because of censors. Censors use up the most amount of resources on our servers. This is why very aggressive methods are used to increased the efficiency of censors. I think I have discussed how the tweak works in previous blog entries. However, this tweak was never programmed into topic_view.php hence why replying to topics with large posts pegged the CPU at 100% for 10 seconds (or 1 second since yesterday).
To fix it, we simply had to port the tweak we made throughout the rest of the forum to topic_review. And volia, fixed =D.
Lets cross our fingers and hope this error does not happen again. If it does, we’ll have to invest into using memcache just like the rest of the forum.
PS Because censors taxes so much CPU, an even faster censors system is to be developed soon.