Go Back   Pligg CMS Forum > Pligg Help > Customization Assistance

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-04-2007, 01:40 PM
fightlinker's Avatar
New Pligger
 
Join Date: Nov 2006
Posts: 27
Thanks: 9
Thanked 0 Times in 0 Posts
My MySQL database kills host's cpu

Hi Guys

The mySQL database for my website was shut down last night and when i got in touch with my host (godaddy) they gave me this reason:

Quote:
Please note that your MySQL username "fightlinker" was found over utilizing the database server and causing a >%90 CPU usage itself. Unfortunately we have had to disable the database username to prevent further issues for all customers on the server. Please note that you will need to correct the load issues with your coding/scripting prior to us re-enabling the username. Please let us know if you have any further issues or concerns that you need to have addressed.
Has anyone had this kind of issue using pligg? I have nearly 5000 links in my database, but i'm not getting any kind of really serious traffic, only around 500 pageloads a day. Anyone have any ideas or advice as to what could be causing this?

Thanks in advance
Ryan
__________________
http://www.fightlinker.com
More MMA news and media than you can handle!
Reply With Quote
  #2 (permalink)  
Old 05-04-2007, 09:49 PM
fightlinker's Avatar
New Pligger
 
Join Date: Nov 2006
Posts: 27
Thanks: 9
Thanked 0 Times in 0 Posts
Here's what they just emailed me:

Quote:
Below is an example of the query that was causing a load issue on our database server which was affecting other customers:

BAD QUERIES:
SELECT DISTINCT pv_user_id, pv_type, pv_page_id FROM pageviews GROUP BY pv_type, pv_page_id, pv_user_id, pv_datetime HAVING (((pv_type)='profile') AND ((pv_page_id)=1) AND pv_user_id > 0) ORDER BY pv_datetime DESC LIMIT 5;

Suggestion:
add a WHERE clause to the query
__________________
http://www.fightlinker.com
More MMA news and media than you can handle!
Reply With Quote
  #3 (permalink)  
Old 05-04-2007, 10:00 PM
Casual Pligger
 
Join Date: Jul 2006
Posts: 34
Thanks: 1
Thanked 5 Times in 3 Posts
The "pageviews" might refer to the Page Statistics module. That module has crashed my entire server every time I've used it (twice), so I disabled it. I'm with LiquidWeb.
Reply With Quote
  #4 (permalink)  
Old 05-05-2007, 12:15 AM
fightlinker's Avatar
New Pligger
 
Join Date: Nov 2006
Posts: 27
Thanks: 9
Thanked 0 Times in 0 Posts
How do you disable it?

Thanks
Ryan
__________________
http://www.fightlinker.com
More MMA news and media than you can handle!
Reply With Quote
  #5 (permalink)  
Old 05-05-2007, 01:12 AM
dollars5's Avatar
Pligg is my love :)
 
Join Date: Dec 2006
Location: India
Posts: 2,154
Thanks: 290
Thanked 266 Times in 177 Posts
Page view table is used to record all page loadings - and page statistics module uses it only if the link to call this module is used - there should be no reason that it would break your site.

If you feel page view table is growing and is causing problems, then you can manually find and comment the select and updates queries for pageview tables that should fix it - but am not sure and have never tried before.
Reply With Quote
  #6 (permalink)  
Old 05-05-2007, 07:17 AM
Constant Pligger
 
Join Date: Mar 2006
Posts: 575
Thanks: 14
Thanked 126 Times in 61 Posts
Wouldn't it be easier to include an admin option in future versions of pligg to turn on / off all pageview reading and writing? I found that the pageview data isn't really necessary, so I removed all references to it. Having it set to off by default will make sure that fewer people will run into trouble with it, since it seems to be causing problems for some.
__________________

Reply With Quote
  #7 (permalink)  
Old 05-05-2007, 07:42 AM
kbeeveer46's Avatar
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,547
Thanks: 254
Thanked 649 Times in 513 Posts
The query above is for the "last 5 people to view this profile" feature.
__________________
I accept donations for my time helping users like you on the forum and IRC.
Reply With Quote
  #8 (permalink)  
Old 05-05-2007, 07:53 AM
Constant Pligger
 
Join Date: Mar 2006
Posts: 575
Thanks: 14
Thanked 126 Times in 61 Posts
I meant anything stored in the pageviews table (profile, story, out records) - it builds up a very large table very quickly, but I wouldn't say the benefit it brings is that great unless you have a specific reason for tracking those kind of events. It is a useful feature to have, but maybe better as optional rather than always on?

On a related note (keeping db table size down) - I was thinking of putting in an extra query on the first stage submit that deletes all "discard" links that are more than, say, 1 hour old.
__________________


Last edited by Simon; 05-05-2007 at 07:56 AM..
Reply With Quote
  #9 (permalink)  
Old 05-05-2007, 11:14 PM
fightlinker's Avatar
New Pligger
 
Join Date: Nov 2006
Posts: 27
Thanks: 9
Thanked 0 Times in 0 Posts
So that query is only generated when the page to view a user's profile is shown? If i go into the files used by that page i can find the code and kill the query?
__________________
http://www.fightlinker.com
More MMA news and media than you can handle!
Reply With Quote
  #10 (permalink)  
Old 05-06-2007, 12:50 AM
dollars5's Avatar
Pligg is my love :)
 
Join Date: Dec 2006
Location: India
Posts: 2,154
Thanks: 290
Thanked 266 Times in 177 Posts
What we do is manually back up them every month and clean up the DB - so no page view accumulation problem
Reply With Quote
Reply

Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Similar Threads
Thread Thread Starter Forum Replies Last Post
Restore Mysql Database from your Backup folder computerbar Modification Tutorials 0 08-22-2008 03:57 PM
Transferring mySQL database phrankle General Help 1 07-15-2008 06:44 PM
Web Host Yankidank Wiki Articles 2 06-26-2008 02:31 PM
Database name, username, password = what?!?! starguy Installation and Upgrade Help 4 06-10-2007 03:29 AM
Installing Pligg on Same MySQL Database as Wordpress Votamli Installation and Upgrade Help 3 05-21-2007 12:18 AM


Search Engine Friendly URLs by vBSEO 3.2.0