Removing Views Increment 4 ever!

stefffff

Joined: 2007-08-25
Posts: 19
Posted: Thu, 2009-10-15 21:26

can someone point me to the location of the views function?
my gallery has been running slow, and my hosting provider is kiiling my apache every once in a while... and they are forcing me to solve this problem

Query | 7 | Copying to tmp table | SELECT g2_ImageBlockCacheMap.g_itemId, g2_ItemAttributesMap.g_viewCount FROM g2_ImageBlockCacheMap L |

Query | 4 | Locked | UPDATE g2_ItemAttributesMap SET g_viewCount = g2_ItemAttributesMap.g_viewCount + 1 WHERE g_itemId=69 |

this is what they say it is the problem.

from what i see here i can bet this has to do something with the views of every photo i have on my site

my gallery is located here: http://www.music-juice.com/gallery2

i have somewhere around 40.000 pictures and this seems to slow down the queries very much!

i just want to get rid of the views incremental function for ever. currently i have deactivated the views count from the admin, but i fear there is a back function still running. can someone help me with this?

here are my gallery2 details

Gallery version = 2.1.2 core 1.1.0.2
PHP version = 5.2.6 apache2handler
Webserver = Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.8b mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.2.6
Database = mysql 5.0.51a-community, lock.system=flock
Toolkits = Exif, Getid3, Thumbnail, Gd, SquareThumb
Acceleration = none, none
Operating system = Linux server3.egazda.ro 2.6.18-53.1.21.el5PAE #1 SMP Tue May 20 10:03:06 EDT 2008 i686
Default theme = matrix
Locale = en_US
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14

thanks in advance!

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16501
Posted: Thu, 2009-10-15 21:54

This is an old post and the code has probably changed:
http://gallery.menalto.com/node/33037

But you're also using an old version too, so....

I'd also suggest upgrading to 2.3:
FAQ: How to upgrade Gallery2?

There have been MANY enhancements to not only security, but features as well as performance.

And if you're looking to increase performance, uninstall GD and get ImageMagick working and take a look at this page:
http://codex.gallery2.org/Gallery2:Performance_Tips

And eventually you may want to look into upgrading to G3 as it's going to perform much better than G2. But that's no small upgrade for a Gallery of that size so there may be other things you need to take into consideration.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
stefffff

Joined: 2007-08-25
Posts: 19
Posted: Fri, 2009-10-16 07:43

oh thank you so much nivekiam! indeed the view count function was removed be deleting the code from modules/core/showitem.inc hopefully now it won't call any queries from the db.

i will try however to update to a newer version of g2, and see what happens next.

i wonder what problems will i have when my db reaches 1.000.000 pictures....