Author Topic: Over 4000 categories - Speed slows down  (Read 5001 times)

0 Members and 1 Guest are viewing this topic.

Offline trez

  • Hero Member
  • *****
  • Posts: 613
    • View Profile
    • blog / photography
Over 4000 categories - Speed slows down
« on: June 20, 2006, 12:17:26 PM »
Hey folks,

I hope anyone can be with me on that. I have over 4000 cat's on my site, i talked with IcEcReaM, he said the site slows very much down, because of that. So, anyone any clue? I tried the following:

- switch off random cat picture / - (no effect just 0.3 seconds faster)
- switch off random picture / - (no effect)
- deleting unused lines in the page_header and index.php / - no effect

IcEcReaM said, every time an user clicks anywhere (by default) 4images is checking all categories, and thats the reason for the slow speed. So, when i have 10.000 categories, the ste will be 2 times slower.

Is anyone go so far go get to a clue for an solution about that problem? ANY help would be very nice, because my users are gettin' bored - i've made a poll - 60% said that the site is loading to slow (over 300 votes)

Regards

Georgi

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Over 4000 categories - Speed slows down
« Reply #1 on: June 20, 2006, 02:35:05 PM »
That is one of the main problem in current 4images structure, nothing you can do about it, perhaps turn on cache system (install a mod if you are using v1.7)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline trez

  • Hero Member
  • *****
  • Posts: 613
    • View Profile
    • blog / photography
Re: Over 4000 categories - Speed slows down
« Reply #2 on: June 20, 2006, 05:52:39 PM »
That is one of the main problem in current 4images structure, nothing you can do about it, perhaps turn on cache system (install a mod if you are using v1.7)

Thanks for the fast answer, i saw also that you have an account on my site :) So, is anyone working on some solution? The cache function loads just the images, so thats not a real solution. I'am trieng to find a way to override the category chek 4images is doing, even if i click on poll (for example) -

I'am working currently with IcEcReaM on that, if we have any progress i will share it.

But any suggestions/clues are welcome :)

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Over 4000 categories - Speed slows down
« Reply #3 on: June 21, 2006, 01:01:09 AM »
Unfortunetly in order to fix it, you'll need rewrite 90% of the 4images code.

The problem is that 4images is loading info about every category into a $cat_cache array and then uses that array when need info about a category.
The only way around it is add extra database quering - that is alot of work. If one would ever changed it, you could call it a new version.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline trez

  • Hero Member
  • *****
  • Posts: 613
    • View Profile
    • blog / photography
Re: Over 4000 categories - Speed slows down
« Reply #4 on: July 19, 2006, 03:15:23 PM »
Hi,

5 days ago, i've made a little advertisement for my site, and 100+ user were logged in and the serverload was going up to 120(!), and of course, my MySQL crashed. You all know me, and ill put almost 8 months of work (not just me) into my site, so its very frustrating and i hope we can come to an resolution.

the problems aren't the categories, even if i put the cache system on, i wouldn't help me, because it handles NOT the user sessions.
I talked yesterday with my server-administrator, he says that...

Quote
1625 | zapomni_4images2 | localhost | zapomni_4images2 | Query   | 285  | Locked       | SELECT cat_id, COUNT(image_id) AS new_images
          FROM 4images_images
          WHERE image_act |
| 1626 | zapomni_4images2 | localhost | zapomni_4images2 | Query   | 287  | Locked       | SELECT cat_id, COUNT(image_id) AS new_images
          FROM 4images_images
          WHERE image_act |
| 1627 | zapomni_4images2 | localhost | zapomni_4images2 | Query   | 283  | Locked       | SELECT cat_id, COUNT(image_id) AS new_images
          FROM 4images_images
          WHERE image_act |
| 1628 | zapomni_4images2 | localhost | zapomni_4images2 | Query   | 284  | Locked       | SELECT cat_id, COUNT(image_id) AS new_images
          FROM 4images_images
          WHERE image_act |
| 1629 | zapomni_4images2 | localhost | zapomni_4images2 | Query   | 284  | Locked       | SELECT cat_id, COUNT(image_id) AS new_images

...is the reason WHY my serverload is going up to 120(!) when more than 70-80 users are logged in. So, that should affect many things in 4images, we removed the block in the global.php - no error messages, even every small count is correct (just defined cat image is not shown)

BUT, after we removed the block, this SQL query is still being performed and still makes issues. So removing the block isn't the resolution, but at least, we know WHERE we have to search the problem and a resolution :)

Everyone, please consider this thread as a try to get to a resolution about this issue, because we can all just make profit from it. I ask everybody, who has a single clue, how we can "override" that problem to post his two cents.

Rewriting the 4images code would be a very big task, but i still believe we can find a second way, an easier way. This issue has to be resolved, in order for people, who are using 4images as a big site cms, with many visitors.

At least, give it a try :)

Regards
Georgi

PS: testaccount created, http://www.zapomnime.com , user "test", pw "test"

Offline trez

  • Hero Member
  • *****
  • Posts: 613
    • View Profile
    • blog / photography
Re: Over 4000 categories - Speed slows down
« Reply #5 on: July 21, 2006, 12:33:42 PM »
nobody ?  8O