View Full Version : Slow forums

Dark Jim
22 Sep 2002, 13:29
This is what I have when I load the showthread.php with 25 posts per page.

Page generated in 19.40027702 seconds (84.14% PHP - 15.86% MySQL) with 54 queries.
[Debug Mode OFF] [PHP v4.1.2] [GZIP disabled] [Server Load: 5.66 5.29 : 4.97]

Hacks I installed that are on the showthread page:
-store hack (glowing username and points)
-a custom title hack (not here in the database)
-local time
-what style are we using?
-quick reply

I also included posts per day and member ID. I don't know if I missed anything.

Any suggestions on making it faster but not by removing hacks? (It's probably not possible but asking anyway) :(

22 Sep 2002, 13:32
Probably the store hack.

Dark Jim
22 Sep 2002, 13:37
That suck as it's one of the coolest hacks. :(

Here is the topic I tested it one btw incase I missed something: http://www.forums.thegaminguniverse.net/showthread.php?threadid=1307

I'll look on other forums where the store hack is installed in see how fast it loads.

22 Sep 2002, 13:39
take a look at your admin/functions.php

function getpostbit

perhaps you have a query in this function.
because of the repeated use of this function in showthread you shoul try to put the query outside of the loop...

Dark Jim
22 Sep 2002, 13:59
Yeah there was 1 query that made the glowing usernames. I changed the query to just a $storeextraglow=$post[username] causing the glow not to work but reduced 1 query per post. The results however where quite unexpected:

Page generated in 23.34848297 seconds (90.71% PHP - 9.29% MySQL) with 28 queries.
[Debug Mode OFF] [PHP v4.1.2] [GZIP disabled] [Server Load: 6.22 6.08 : 5.60]

Seeing that the PHP % is quite high (compared to this forum), my guess is the code is quite unefficient. That or my host sucks. Any suggestions?

22 Sep 2002, 14:03
well is your MySQL-Server the same as your PHP Server or are it two servers?

if it's the same server then i'd say the code is very unefficient, if not it could be your host...

Dark Jim
22 Sep 2002, 14:07
No I don't think so. The database uses space from my main site. Maybe I should ask my host.

Dark Jim
22 Sep 2002, 14:09
Gee, I added the glow back and now it's:

Page generated in 13.95904005 seconds (61.41% PHP - 38.59% MySQL) with 54 queries.
[Debug Mode OFF] [PHP v4.1.2] [GZIP disabled] [Server Load: 4.27 4.68 : 5.07]

??? It must be the host.

22 Sep 2002, 14:28
we'll just looked at your site and it was very slow, seems like the host isn't very fast..

but of course optimizing code is always a good idea ;)

btw. nice color style

Dark Jim
22 Sep 2002, 14:31
Yeah it is most certainly the host as on an other site I admin that has the same hacks it does load faster.

And thanks. :)

22 Sep 2002, 18:26
that link you gave us, the page is 286kb...wow...huge...:o

Dark Jim
22 Sep 2002, 20:14
Ack it is?! But I just checked the other site with the same stuff and it was around 260 kB and faster. Plus I have cable and it is still very slow.

Edit: Oh and I checked a big topic page here and it was 185kb but 10x or so faster so it's not the size that causes the slowness or just a little part of it.

23 Sep 2002, 02:59
You can use glow for usernames just using templates and custom userfields - which adds NO query. Just experiment. It can be done.