Speed of posting replies slow - but site fast!

craigiri

Well-known member
I know we've had many discussions about speeding up our sites, but this one doesn't seem to be addressed by itself.

That is, my site is very fast - searching, listing and just clicking around.
My server load is quite low - less than 1 with a quad-core.
RAM is available - CPU use is not high.

YET, at a number of times in the last couple of days, adding replies to a thread seem quite slow. The little timer on the upper right comes on and sometimes lasts 5 seconds or longer.

Are there any hints here already - or any which folks can post here, which address possible logjams which may slow JUST that particular part of a forum - taking all of the above into account?
 
You can add these lines in library/config.php to display the page execution time:
Code:
$ips = array('199.99.444.555');
$config['debug'] = (in_array($_SERVER['REMOTE_ADDR'], $ips) ? true : false);
Go to whatismyip.com and copy the IP address into the first line.

Then whenever you visit a page in your forum, you see at the bottom of the page the time your server needed to output this page.
 
Marcus, all the pages are very fast and the CPU is not being taxed.

It is just the insertion of new material that causes the delay - that little thingy comes up on the right upper side and it takes 5-10 seconds for the page to refresh.

I suspect it is related to the delayed writes and table locking in mysql, as there were/are a very high number of them showing. 1600 of them since I restarted the process about 12 minutes ago. Just a guess.....

So I'm looking to see if any mysql gurus know how to specifically deal with speeding up inserts...when it seems like the server has room to do so! I will check with my admin (ISP dude) also - he's pretty smart on this stuff.
 
Marcus, all the pages are very fast and the CPU is not being taxed.

It is just the insertion of new material that causes the delay - that little thingy comes up on the right upper side and it takes 5-10 seconds for the page to refresh.

I suspect it is related to the delayed writes and table locking in mysql, as there were/are a very high number of them showing. 1600 of them since I restarted the process about 12 minutes ago. Just a guess.....

So I'm looking to see if any mysql gurus know how to specifically deal with speeding up inserts...when it seems like the server has room to do so! I will check with my admin (ISP dude) also - he's pretty smart on this stuff.
I ran into this. Try disabling email notifications and see if that helps.
The email notifications run in the same thread as the request, and were making all replies and posting really really slow

Try adding this in your config.php and test again, if the site is responsive, then you know it was the email

Code:
$config['enableMail'] = false;
 
Hmmm....another tidbit

Posting in a private mod forum is MUCH quicker.....but a public or members-only forum is slower....

Should that be the case anyway? The members-only forum in this case does not have a lot of posts in it.....
 
Hmmm....another tidbit

Posting in a private mod forum is MUCH quicker.....but a public or members-only forum is slower....

Should that be the case anyway? The members-only forum in this case does not have a lot of posts in it.....

The insert goes through the same table, so the amount of threads or post in the forum holds no correlation to the actual speed.
Is posting a new thread as slow as posting in an existing thread ?

Next suggestion: try disabling all the addons and see if the performance increases
Code:
$config['enableListeners'] = true;
 
My guess is that it's mostly adding to a thread......none of the reported slowdowns were new threads.

Right this minute it seems to have sped up a bit - but I will monitor over the evening and report back...and check next time is disabling the add-ons does anything.

I should mention that I have very few add-ons and no new ones...and everything worked fine up until yesterday. At the same time, our db is growing and I know sometimes that slows things down....and also our busy time is here, although we are not "over the top" yet as far as traffic - 1,000 posts a day should be a piece of cake for a dedicated server.
 
Once the post makes it to the thread, editing is instant...not sure if that's a hint.

My ISP is in there looking around at mysql logs now.....I'll report back if we find out anything.
 
My guess is that it's mostly adding to a thread......none of the reported slowdowns were new threads.

Right this minute it seems to have sped up a bit - but I will monitor over the evening and report back...and check next time is disabling the add-ons does anything.

I should mention that I have very few add-ons and no new ones...and everything worked fine up until yesterday. At the same time, our db is growing and I know sometimes that slows things down....and also our busy time is here, although we are not "over the top" yet as far as traffic - 1,000 posts a day should be a piece of cake for a dedicated server.

All the information you gave to me kind of falls back to that email issue ...

We discussed it a while ago
http://xenforo.com/community/threads/mail-queue-w-priority.25941/#post-313494

Basically the issue is .. on new threads they are really fast, as there are no people subscribed to the thread, but on existing thread, and especially if the default is subscribe using email, the replies become really really slow

Anyway, since it is a dedicated server, you can try a couple more things, one is on the mysql console or phpmyadmin, do a "SHOW PROCESSLIST" while posting something, so you can actually see if there is a query blocking things

The second one is, depending on how you are starting mysql, you could go to the script (e.g. /etc/init.d/mysqld) and on the line that starts mysql log the slow queries, i.e.

Code:
/usr/bin/mysqld_safe  
                --log-slow-queries=/var/log/mysql/slow_queries
               ....

That will give you a log of which are the offending queries (if any). It could also be that your buffers for InnoDB are too low, but that will give you general slowness, instead of slowness only in some forums/threads
 
Great.....the email issue does not make sense, because one of the threads which was slow today has only 5 people who posted in it. Yet a similar short thread in another forum was quick as heck.

We are going to check out all of the other stuff.
 
I am having this exact same issue...new threads speedy, navigating around the forum...speedy, replying to posts, sometimes speedy, sometimes 5-20 seconds.

I've tried disabling email notifications.

This problem has only appeared in the past 2 days.
 
I suspect I could fix up my mysql conf a bit. It's really quite ragged.
Any suggestions for ALL the needed lines in setup for mostly XF with the following specs?

Server
8 Gig Ram
4 core 2.6 XEON

XF
1.2 million posts
22,000 members
Elasticsearch (eats up some RAM)

Other - maybe 15% of the rest of the site (traffic) is served by older php/mysql ISAM tables and an old CMS. This, along with the ISAM tables in XF, probably need some settings in my.cnf?

All on centos with mysql 5.0.77

Sample conf settings welcome!

Also, would upgrading mysql help a lot with something like this?

 
Top Bottom