News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

SMF optimization suggestion

Started by ashish101, May 08, 2011, 05:50:10 AM

Previous topic - Next topic

ashish101

I tried other things with Apache-PHP but they were causing more issues. Things are looking pretty stable now.

Thanks everyone for their precious time and help.

Cheers

ashish101

Just to update, tried mpm_worker again but for some reason it was making server literally crash. I have now configured nginx as reverse proxy for static content and the server is lightning fast now.

Also, I noticed some frequent PHP fatal errors:-
PHP Fatal error:  Allowed memory size of 165675008 bytes exhausted (tried to allocate 20 bytes) in ....../Sources/GoogleTagged.php on line 336

Any idea?

Something like that

In php.ini, change memory_limit from 16M to something higher... say 32M?

ashish101

Quote from: «Mark» on June 13, 2011, 12:39:27 PM
In php.ini, change memory_limit from 16M to something higher... say 32M?

memory_limit was actually set to 128M then increased to 160M and now it's 200M. The frequency of this error has decreased but it's still there.

Something like that

Quote from: anurag08 on June 13, 2011, 12:44:39 PM
Quote from: «Mark» on June 13, 2011, 12:39:27 PM
In php.ini, change memory_limit from 16M to something higher... say 32M?

memory_limit was actually set to 128M then increased to 160M and now it's 200M. The frequency of this error has decreased but it's still there.

Then that mod has more problems than crappy SQL queries lol

ashish101

Culprit is same script again, Googletagged.php. I am using the script you gave me, but still it's too much. Do you think converting Googletagged table to InnoDB would make any difference?
Thanks again :)

Something like that

Quote from: anurag08 on June 13, 2011, 07:05:21 PM
Culprit is same script again, Googletagged.php. I am using the script you gave me, but still it's too much. Do you think converting Googletagged table to InnoDB would make any difference?
Thanks again :)

Unlikely. If it's using insane RAM like that, something else is up.

samurai-lupin

Quote from: «Mark» on May 27, 2011, 11:48:06 PM


ALTER TABLE smf_googletagged
ADD INDEX status_idtag (status, id_tag);


So here's my revised version:


SELECT tag, id_tag, hits, status, id_topic
FROM
(
    SELECT @cnt := COUNT(*) + 1, @lim := 50
    FROM smf_googletagged
    WHERE status != 0
    GROUP BY id_tag
) vars
STRAIGHT_JOIN
(
    SELECT tag, id_tag, hits, status, id_topic, @lim := @lim - 1
    FROM smf_googletagged
    WHERE status != 0
        AND (@cnt := @cnt - 1)
        AND RAND() < @lim / @cnt
    GROUP BY id_tag
) data
ORDER BY RAND()



Hello Mark,

I just found your posting through the board search. I am also encountering a big problem due to the Google Tagged Table in my Database. Yesterday my server load went to over 20 Cores (I am on a 4 core dedicated box). My server status looked like what I am quoting below ....

So if I do run your two querries from above should this help easen the problem?

My Googlöe Tagged table is in the ibd format (smf_googletagged.ibd)

Sorry probably being a dummy on this :)

Thanks!

--------

Operating System:    CentOS release 5.5 (Final)
Processor:    Intel® Xeon(TM) CPU @ 2.00GHz (1992.000MHz)
Load averages:    16.47, 14.78, 9.86
Current processes:    289 (282 sleeping, 6 running, 1 zombie)
Processes by CPU:    mysqld (1) 119.0%, httpd (124) 22.0%, (other) (84) 0.9%
Memory usage:    96.125% (3991092k / 4151960k)
Swap: 10.21% (107064k / 1048568k)
MySQL processes
Total processes:    105 (17 sleeping, 84 running, 4 locked)

Running processes
State    Time    Query
Copying to tmp table    63s    

SELECT g.ID_TAG, g.tag, g.status, g.hits, g.ID_TOPIC, t.ID_FIRST_MSG, t.ID_LAST_MSG, b.name AS bname,
      t.ID_BOARD, t.ID_POLL, t.isSticky, t.locked, t.numReplies, t.numViews,
      ms.ID_MEMBER, ms.ID_TOPIC, ms.posterTime AS firstPosterTime, ms.posterTime, ms.subject AS firstSubject,
      ms.ID_MEMBER AS ID_FIRST_MEMBER, ms.posterName AS firstPosterName, ml.subject AS lastSubject,
      ms.icon AS firstIcon, ms.smileysEnabled AS firstSmileys,
      ml.ID_MEMBER AS ID_LAST_MEMBER, ml.posterTime AS lastPosterTime, ml.modifiedTime AS lastModifiedTime,
      ml.ID_TOPIC, ml.subject AS lastSubject, ml.posterName AS lastPosterName, ml.icon AS lastIcon,
      ml.modifiedTime AS lastModifiedTime, ml.smileysEnabled AS lastSmileys
FROM (smf_googletagged as g, smf_boards AS b, smf_topics as t,
      smf_messages AS ms, smf_messages AS ml)
WHERE tag = ''
   AND g.status != 0
   AND b.ID_BOARD = t.ID_BOARD
   AND g.ID_TOPIC = t.ID_TOPIC
   AND ms.ID_MSG = t.ID_FIRST_MSG
   AND ml.ID_MSG = t.ID_LAST_MSG
   AND FIND_IN_SET(-1, b.memberGroups)AND CHAR_LENGTH(b.passwd) = 0
ORDER BY g.hits DESC
LIMIT 875, 25

Copying to tmp table    32s    

SELECT
   att.ID_ATTACH, att.ID_MSG, att.filename, IFNULL(att.size, 0) AS filesize, att.downloads, mem.ID_MEMBER,
   IFNULL(mem.realName, m.posterName) AS posterName, m.ID_TOPIC, m.subject, t.ID_BOARD, m.posterTime,
   att.width, att.height, IFNULL(thumb.ID_ATTACH, 0) AS id_thumb, thumb.width AS thumb_width, thumb.height AS thumb_height
FROM smf_attachments AS att
   INNER JOIN smf_messages AS m ON (m.ID_MSG = att.ID_MSG)
   INNER JOIN smf_topics AS t ON (t.ID_TOPIC = m.ID_TOPIC)
   LEFT JOIN smf_members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)
   LEFT JOIN smf_attachments AS thumb ON (thumb.ID_ATTACH = att.ID_THUMB)
   LEFT JOIN smf_boards AS b ON (b.ID_BOARD = t.ID_BOARD)
WHERE att.attachmentType = 3
   AND att.width != 0
   AND ( (FIND_IN_SET(0, b.memberGroups) OR FIND_IN_SET(5, b.memberGroups)))AND CHAR_LENGTH(b.passwd) = 0
   
GROUP BY t.ID_TOPIC
ORDER BY att.ID_ATTACH DESC
LIMIT 4

Copying to tmp table    5s    

SELECT
   att.ID_ATTACH, att.ID_MSG, att.filename, IFNULL(att.size, 0) AS filesize, att.downloads, mem.ID_MEMBER,
   IFNULL(mem.realName, m.posterName) AS posterName, m.ID_TOPIC, m.subject, t.ID_BOARD, m.posterTime,
   att.width, att.height, IFNULL(thumb.ID_ATTACH, 0) AS id_thumb, thumb.width AS thumb_width, thumb.height AS thumb_height
FROM smf_attachments AS att
   INNER JOIN smf_messages AS m ON (m.ID_MSG = att.ID_MSG)
   INNER JOIN smf_topics AS t ON (t.ID_TOPIC = m.ID_TOPIC)
   LEFT JOIN smf_members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)
   LEFT JOIN smf_attachments AS thumb ON (thumb.ID_ATTACH = att.ID_THUMB)
   LEFT JOIN smf_boards AS b ON (b.ID_BOARD = t.ID_BOARD)
WHERE att.attachmentType = 3
   AND att.width != 0
   AND FIND_IN_SET(-1, b.memberGroups)AND CHAR_LENGTH(b.passwd) = 0
    AND m.ID_BOARD IN (5,9,10,11,63,64,65,66,67,69,70,71,72,73,75,76,77,78,79,81,82,83,84,85,86,87,106,107,109,110,111,112,113,117,121,123,137)
GROUP BY t.ID_TOPIC
ORDER BY att.ID_ATTACH DESC
LIMIT 8

Copying to tmp table    4s    

SELECT
   att.ID_ATTACH, att.ID_MSG, att.filename, IFNULL(att.size, 0) AS filesize, att.downloads, mem.ID_MEMBER,
   IFNULL(mem.realName, m.posterName) AS posterName, m.ID_TOPIC, m.subject, t.ID_BOARD, m.posterTime,
   att.width, att.height, IFNULL(thumb.ID_ATTACH, 0) AS id_thumb, thumb.width AS thumb_width, thumb.height AS thumb_height
FROM smf_attachments AS att
   INNER JOIN smf_messages AS m ON (m.ID_MSG = att.ID_MSG)
   INNER JOIN smf_topics AS t ON (t.ID_TOPIC = m.ID_TOPIC)
   LEFT JOIN smf_members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)
   LEFT JOIN smf_attachments AS thumb ON (thumb.ID_ATTACH = att.ID_THUMB)
   LEFT JOIN smf_boards AS b ON (b.ID_BOARD = t.ID_BOARD)
WHERE att.attachmentType = 3
   AND att.width != 0
   AND ( (FIND_IN_SET(0, b.memberGroups) OR FIND_IN_SET(9, b.memberGroups)))AND CHAR_LENGTH(b.passwd) = 0
    AND m.ID_BOARD IN (5,9,10,11,63,64,65,66,67,69,70,71,72,73,75,76,77,78,79,81,82,83,84,85,86,87,106,107,109,110,111,112,113,117,121,123,137)
GROUP BY t.ID_TOPIC
ORDER BY att.ID_ATTACH DESC
LIMIT 8

Copying to tmp table    36s    

SELECT
   att.ID_ATTACH, att.ID_MSG, att.filename, IFNULL(att.size, 0) AS filesize, att.downloads, mem.ID_MEMBER,
   IFNULL(mem.realName, m.posterName) AS posterName, m.ID_TOPIC, m.subject, t.ID_BOARD, m.posterTime,
   att.width, att.height, IFNULL(thumb.ID_ATTACH, 0) AS id_thumb, thumb.width AS thumb_width, thumb.height AS thumb_height
FROM smf_attachments AS att
   INNER JOIN smf_messages AS m ON (m.ID_MSG = att.ID_MSG)
   INNER JOIN smf_topics AS t ON (t.ID_TOPIC = m.ID_TOPIC)
   LEFT JOIN smf_members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)
   LEFT JOIN smf_attachments AS thumb ON (thumb.ID_ATTACH = att.ID_THUMB)
   LEFT JOIN smf_boards AS b ON (b.ID_BOARD = t.ID_BOARD)
WHERE att.attachmentType = 3
   AND att.width != 0
   AND ( (FIND_IN_SET(0, b.memberGroups) OR FIND_IN_SET(7, b.memberGroups)))AND CHAR_LENGTH(b.passwd) = 0
    AND m.ID_BOARD IN (5,9,10,11,63,64,65,66,67,69,70,71,72,73,75,76,77,78,79,81,82,83,84,85,86,87,106,107,109,110,111,112,113,117,121,123,137)
GROUP BY t.ID_TOPIC
ORDER BY att.ID_ATTACH DESC
LIMIT 8

Copying to tmp table    30s    

SELECT
   att.ID_ATTACH, att.ID_MSG, att.filename, IFNULL(att.size, 0) AS filesize, att.downloads, mem.ID_MEMBER,
   IFNULL(mem.realName, m.posterName) AS posterName, m.ID_TOPIC, m.subject, t.ID_BOARD, m.posterTime,
   att.width, att.height, IFNULL(thumb.ID_ATTACH, 0) AS id_thumb, thumb.width AS thumb_width, thumb.height AS thumb_height
FROM smf_attachments AS att
   INNER JOIN smf_messages AS m ON (m.ID_MSG = att.ID_MSG)
   INNER JOIN smf_topics AS t ON (t.ID_TOPIC = m.ID_TOPIC)
   LEFT JOIN smf_members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)
   LEFT JOIN smf_attachments AS thumb ON (thumb.ID_ATTACH = att.ID_THUMB)
   LEFT JOIN smf_boards AS b ON (b.ID_BOARD = t.ID_BOARD)
WHERE att.attachmentType = 3
   AND att.width != 0
   AND ( (FIND_IN_SET(0, b.memberGroups) OR FIND_IN_SET(6, b.memberGroups)))AND CHAR_LENGTH(b.passwd) = 0
   
GROUP BY t.ID_TOPIC
ORDER BY att.ID_ATTACH DESC
LIMIT 4

Copying to tmp table    56s    

SELECT g.ID_TAG, g.tag, g.status, g.hits, g.ID_TOPIC, t.ID_FIRST_MSG, t.ID_LAST_MSG, b.name AS bname,
      t.ID_BOARD, t.ID_POLL, t.isSticky, t.locked, t.numReplies, t.numViews,
      ms.ID_MEMBER, ms.ID_TOPIC, ms.posterTime AS firstPosterTime, ms.posterTime, ms.subject AS firstSubject,
      ms.ID_MEMBER AS ID_FIRST_MEMBER, ms.posterName AS firstPosterName, ml.subject AS lastSubject,
      ms.icon AS firstIcon, ms.smileysEnabled AS firstSmileys,
      ml.ID_MEMBER AS ID_LAST_MEMBER, ml.posterTime AS lastPosterTime, ml.modifiedTime AS lastModifiedTime,
      ml.ID_TOPIC, ml.subject AS lastSubject, ml.posterName AS lastPosterName, ml.icon AS lastIcon,
      ml.modifiedTime AS lastModifiedTime, ml.smileysEnabled AS lastSmileys
FROM (smf_googletagged as g, smf_boards AS b, smf_topics as t,
      smf_messages AS ms, smf_messages AS ml)
WHERE tag = ''
   AND g.status != 0
   AND b.ID_BOARD = t.ID_BOARD
   AND g.ID_TOPIC = t.ID_TOPIC
   AND ms.ID_MSG = t.ID_FIRST_MSG
   AND ml.ID_MSG = t.ID_LAST_MSG
   AND FIND_IN_SET(-1, b.memberGroups)AND CHAR_LENGTH(b.passwd) = 0
ORDER BY g.hits DESC
LIMIT 50, 25

Sending data    1s    

SELECT COUNT(*)
FROM smf_topics AS t
   LEFT JOIN smf_log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = 2398)
   LEFT JOIN smf_log_mark_read AS lmr ON (lmr.ID_BOARD = t.ID_BOARD AND lmr.ID_MEMBER = 2398)
WHERE t.ID_BOARD IN (182, 28, 51, 139, 140, 141, 36, 142, 143, 154, 144, 29, 30, 33, 129, 32, 35, 62, 91, 130, 181, 93, 94, 164, 37, 38, 90, 122, 109, 121, 123, 107, 76, 83, 106, 9, 11, 5, 70, 73, 77, 78, 79, 63, 137, 117, 81, 82, 75, 69, 64, 67, 65, 66, 84, 86, 87, 85, 22, 25, 26, 162, 27, 138, 168, 161, 24, 145, 146, 147, 148, 149, 150, 151, 152, 153, 95, 23, 34, 31, 16, 17, 89, 88, 52, 19, 18, 13, 14, 15, 131, 100, 101, 102, 103, 12, 128, 105, 6, 7, 163, 4, 118, 169, 96, 97, 98, 99, 160, 119, 172, 132, 166, 167, 127, 3, 60, 39, 157, 155, 180, 40, 41, 42, 170, 43, 44, 45, 46, 50, 55, 53, 54, 56, 57, 58, 159, 59, 61, 47, 48, 49)
   AND IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, 0)) < t.ID_LAST_MSG

Sending data    10s    

SELECT COUNT(*) AS koll, SUM(size) AS totalsize, SUM(downloads) as down
                           FROM smf_attachments
                           WHERE Poster_ID=4577
   AND attachmentType!=3

Copying to tmp table    1s    

SELECT p.ID_POLL, p.question, t.ID_TOPIC, p.maxVotes
FROM (smf_polls AS p, smf_boards AS b, smf_topics AS t)
   LEFT JOIN smf_log_polls AS lp ON (lp.ID_POLL = p.ID_POLL AND lp.ID_MEMBER = 0)
WHERE p.votingLocked = 0
   AND lp.ID_CHOICE IS NULL
   AND t.ID_POLL = p.ID_POLL
   AND b.ID_BOARD = t.ID_BOARD
   AND FIND_IN_SET(-1, b.memberGroups)AND CHAR_LENGTH(b.passwd) = 0
   AND b.ID_BOARD IN (120, 114, 173, 135, 174, 175, 176, 177, 178, 136, 158, 171, 28, 51, 139, 140, 141, 36, 142, 143, 154, 144, 156, 29, 30, 33, 129, 32, 35, 62, 91, 92, 130, 181, 93, 94, 164, 37, 38, 90, 122, 121, 123, 107, 76, 83, 106, 9, 11, 5, 73, 77, 78, 79, 63, 137, 117, 81, 82, 75, 69, 64, 67, 65, 66, 84, 86, 87, 85, 22, 25, 26, 162, 27, 138, 168, 161, 24, 145, 146, 147, 148, 149, 150, 151, 152, 153, 95, 23, 34, 31, 16, 17, 89, 88, 52, 19, 18, 13, 14, 15, 131, 100, 101, 102, 103, 12, 128, 105, 6, 7, 163, 4, 118, 169, 96, 97, 98, 99, 160, 119, 172, 132, 166, 167, 127, 3, 60, 39, 157, 155, 180, 40, 41, 42, 170, 43, 44, 45, 46, 50, 55, 53, 54, 56, 57, 58, 159, 59, 61, 47, 48, 49, 10, 70, 71, 72, 104, 108, 109, 110, 111, 112, 113, 116, 179)
ORDER BY p.ID_POLL DESC
LIMIT 1

Copying to tmp table    29s    

SELECT g.ID_TAG, g.tag, g.status, g.hits, g.ID_TOPIC, t.ID_FIRST_MSG, t.ID_LAST_MSG, b.name AS bname,
      t.ID_BOARD, t.ID_POLL, t.isSticky, t.locked, t.numReplies, t.numViews,
      ms.ID_MEMBER, ms.ID_TOPIC, ms.posterTime AS firstPosterTime, ms.posterTime, ms.subject AS firstSubject,
      ms.ID_MEMBER AS ID_FIRST_MEMBER, ms.posterName AS firstPosterName, ml.subject AS lastSubject,
      ms.icon AS firstIcon, ms.smileysEnabled AS firstSmileys,
      ml.ID_MEMBER AS ID_LAST_MEMBER, ml.posterTime AS lastPosterTime, ml.modifiedTime AS lastModifiedTime,
      ml.ID_TOPIC, ml.subject AS lastSubject, ml.posterName AS lastPosterName, ml.icon AS lastIcon,
      ml.modifiedTime AS lastModifiedTime, ml.smileysEnabled AS lastSmileys
FROM (smf_googletagged as g, smf_boards AS b, smf_topics as t,
      smf_messages AS ms, smf_messages AS ml)
WHERE tag = ''
   AND g.status != 0
   AND b.ID_BOARD = t.ID_BOARD
   AND g.ID_TOPIC = t.ID_TOPIC
   AND ms.ID_MSG = t.ID_FIRST_MSG
   AND ml.ID_MSG = t.ID_LAST_MSG
   AND FIND_IN_SET(-1, b.memberGroups)AND CHAR_LENGTH(b.passwd) = 0
ORDER BY g.hits DESC
LIMIT 650, 25

Copying to tmp table    64s    

SELECT g.ID_TAG, g.tag, g.status, g.hits, g.ID_TOPIC, t.ID_FIRST_MSG, t.ID_LAST_MSG, b.name AS bname,
      t.ID_BOARD, t.ID_POLL, t.isSticky, t.locked, t.numReplies, t.numViews,
      ms.ID_MEMBER, ms.ID_TOPIC, ms.posterTime AS firstPosterTime, ms.posterTime, ms.subject AS firstSubject,
      ms.ID_MEMBER AS ID_FIRST_MEMBER, ms.posterName AS firstPosterName, ml.subject AS lastSubject,
      ms.icon AS firstIcon, ms.smileysEnabled AS firstSmileys,
      ml.ID_MEMBER AS ID_LAST_MEMBER, ml.posterTime AS lastPosterTime, ml.modifiedTime AS lastModifiedTime,
      ml.ID_TOPIC, ml.subject AS lastSubject, ml.posterName AS lastPosterName, ml.icon AS lastIcon,
      ml.modifiedTime AS lastModifiedTime, ml.smileysEnabled AS lastSmileys
FROM (smf_googletagged as g, smf_boards AS b, smf_topics as t,
      smf_messages AS ms, smf_messages AS ml)
WHERE tag = ''
   AND g.status != 0
   AND b.ID_BOARD = t.ID_BOARD
   AND g.ID_TOPIC = t.ID_TOPIC
   AND ms.ID_MSG = t.ID_FIRST_MSG
   AND ml.ID_MSG = t.ID_LAST_MSG
   AND FIND_IN_SET(-1, b.memberGroups)AND CHAR_LENGTH(b.passwd) = 0
ORDER BY t.numViews
LIMIT 0, 25

Copying to tmp table    66s    

SELECT g.ID_TAG, g.tag, g.status, g.hits, g.ID_TOPIC, t.ID_FIRST_MSG, t.ID_LAST_MSG, b.name AS bname,
      t.ID_BOARD, t.ID_POLL, t.isSticky, t.locked, t.numReplies, t.numViews,
      ms.ID_MEMBER, ms.ID_TOPIC, ms.posterTime AS firstPosterTime, ms.posterTime, ms.subject AS firstSubject,
      ms.ID_MEMBER AS ID_FIRST_MEMBER, ms.posterName AS firstPosterName, ml.subject AS lastSubject,
      ms.icon AS firstIcon, ms.smileysEnabled AS firstSmileys,
      ml.ID_MEMBER AS ID_LAST_MEMBER, ml.posterTime AS lastPosterTime, ml.modifiedTime AS lastModifiedTime,
      ml.ID_TOPIC, ml.subject AS lastSubject, ml.posterName AS lastPosterName, ml.icon AS lastIcon,
      ml.modifiedTime AS lastModifiedTime, ml.smileysEnabled AS lastSmileys
FROM (smf_googletagged as g, smf_boards AS b, smf_topics as t,
      smf_messages AS ms, smf_messages AS ml)
WHERE tag = ''
   AND g.status != 0
   AND b.ID_BOARD = t.ID_BOARD
   AND g.ID_TOPIC = t.ID_TOPIC
   AND ms.ID_MSG = t.ID_FIRST_MSG
   AND ml.ID_MSG = t.ID_LAST_MSG
   AND FIND_IN_SET(-1, b.memberGroups)AND CHAR_LENGTH(b.passwd) = 0
ORDER BY g.hits DESC
LIMIT 975, 25

Copying to tmp table    23s    

SELECT g.ID_TAG, g.tag, g.status, g.hits, g.ID_TOPIC, t.ID_FIRST_MSG, t.ID_LAST_MSG, b.name AS bname,
      t.ID_BOARD, t.ID_POLL, t.isSticky, t.locked, t.numReplies, t.numViews,
      ms.ID_MEMBER, ms.ID_TOPIC, ms.posterTime AS firstPosterTime, ms.posterTime, ms.subject AS firstSubject,
      ms.ID_MEMBER AS ID_FIRST_MEMBER, ms.posterName AS firstPosterName, ml.subject AS lastSubject,
      ms.icon AS firstIcon, ms.smileysEnabled AS firstSmileys,
      ml.ID_MEMBER AS ID_LAST_MEMBER, ml.posterTime AS lastPosterTime, ml.modifiedTime AS lastModifiedTime,
      ml.ID_TOPIC, ml.subject AS lastSubject, ml.posterName AS lastPosterName, ml.icon AS lastIcon,
      ml.modifiedTime AS lastModifiedTime, ml.smileysEnabled AS lastSmileys
FROM (smf_googletagged as g, smf_boards AS b, smf_topics as t,
      smf_messages AS ms, smf_messages AS ml)
WHERE tag = ''
   AND g.status != 0
   AND b.ID_BOARD = t.ID_BOARD
   AND g.ID_TOPIC = t.ID_TOPIC
   AND ms.ID_MSG = t.ID_FIRST_MSG
   AND ml.ID_MSG = t.ID_LAST_MSG
   AND FIND_IN_SET(-1, b.memberGroups)AND CHAR_LENGTH(b.passwd) = 0
ORDER BY g.hits DESC
LIMIT 925, 25


ashish101

I would highly suggest to use Mark's script. I had the same problem and Mark's script worked like a charm. I am still getting some errors but it's nothing in comparison to before and the server load is heaps better. Also, I installed nginx to reduce server load, infact this was the best thing I installed ever, reduced server load to almost nothing even for high loads.

Advertisement: