Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 29th Nov 2011, 05:32 AM   #1
Ram07
 
ram07's Avatar
 
Join Date: 2010
Location: Texas
Posts: 57
Thanks: 1
Thanked 5 Times in 4 Posts
Lightbulb
Need help with mysql optimization
Share on: 
fb share twitter share gplus share more share

Hi every one,

I am in deep trouble with my client site, Often the server gets crashed. We have a dedicated server so that we can restart the server. Then its working fine.

By the time the server crash gets worse. I have found few things from the error log. Here are those,

1) [client 128.61.28.185] PHP Warning: mysql_pconnect():
Can't create a new thread (errno 12); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug in /httpdocs/includes/functions/database.php on line 18


2) [client 219.133.223.184] PHP Warning: mysql_query(): Too many connections /httpdocs/inc_rating.php on line 91, 97, 100, 106

3) [Tue Nov 29 00:08:26 2011] [crit] [client 122.164.131.157] (13)Permission denied: /httpdocs/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable, referer: /login.php

Site type : Oscommerce
DB size : 127 MiB
Control panel : Plesk

Please let me know if could find any solution on this. Awaiting for your replay.

Thank you.


ram07 is offline  
Unread 29th Nov 2011, 05:50 AM   #2
HyperActive Warrior
War Room Member
 
MariusPrice's Avatar
 
Join Date: 2011
Location: Sweden
Posts: 215
Thanks: 8
Thanked 74 Times in 43 Posts
Blog Entries: 4
Default
Re: Need help with mysql optimization
Share on: 
fb share twitter share gplus share more share

Originally Posted by ram07 View Post

Hi every one,

I am in deep trouble with my client site, Often the server gets crashed. We have a dedicated server so that we can restart the server. Then its working fine.

By the time the server crash gets worse. I have found few things from the error log. Here are those,

1) [client 128.61.28.185] PHP Warning: mysql_pconnect():
Can't create a new thread (errno 12); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug in /httpdocs/includes/functions/database.php on line 18


2) [client 219.133.223.184] PHP Warning: mysql_query(): Too many connections /httpdocs/inc_rating.php on line 91, 97, 100, 106

3) [Tue Nov 29 00:08:26 2011] [crit] [client 122.164.131.157] (13)Permission denied: /httpdocs/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable, referer: /login.php

Site type : Oscommerce
DB size : 127 MiB
Control panel : Plesk

Please let me know if could find any solution on this. Awaiting for your replay.

Thank you.
I never worked with Oscommerce but its seems that you have some writing permission problems on your server.

You had the site on this dedicated server from beginning?

Maybe i can help since i work with my own server.
Give me more details about what Linux system you running on server, do you have SSH access and whats the company from where you bought dedicated server and witch plan so i can take a look.
MariusPrice is offline  
Unread 29th Nov 2011, 06:07 AM   #3
Active Warrior
 
Join Date: 2011
Posts: 61
Thanks: 14
Thanked 1 Time in 1 Post
Default
Re: Need help with mysql optimization
Share on: 
fb share twitter share gplus share more share

1) [client 128.61.28.185] PHP Warning: mysql_pconnect():
Can't create a new thread (errno 12); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug in /httpdocs/includes/functions/database.php on line 18
Your sites traffic is too high.. may be you have to increase the no. of simultaneously sql connection limit..
scriptkid is offline  
Unread 29th Nov 2011, 06:17 AM   #4
Ram07
 
ram07's Avatar
 
Join Date: 2010
Location: Texas
Posts: 57
Thanks: 1
Thanked 5 Times in 4 Posts
Default
Re: Need help with mysql optimization
Share on: 
fb share twitter share gplus share more share

Hi Marius,

Thanks for your quick replay. here are the details of my server.

Host : Frontline
Plan : VPS Pro Linux
Operating system : Linux 2.6.9-023stab051.3-enterprise
CPU : GenuineIntel, Intel(R) Xeon(R)CPU E5345 @ 2.33GHz
Average load : 0.12; 0.10; 0.09


Hey, I have forgot to say about the CUP usage, when we login to our admin side (2-5) members the CPU usage reaches 170%.

We have used few joint queries in orders page and listed 100 results in one page (pagination).

And also, we have used curl to get the country details and country flag using the ip address from a third party website.

These are all the information that i know about the server, SSH - i am not familiar with the server side.

Please consider these information and give you suggestion how to stop the server crash.

Thank you.


ram07 is offline  
Unread 29th Nov 2011, 06:29 AM   #5
HyperActive Warrior
War Room Member
 
MariusPrice's Avatar
 
Join Date: 2011
Location: Sweden
Posts: 215
Thanks: 8
Thanked 74 Times in 43 Posts
Blog Entries: 4
Default
Re: Need help with mysql optimization
Share on: 
fb share twitter share gplus share more share

Originally Posted by ram07 View Post

Hi Marius,

Thanks for your quick replay. here are the details of my server.

Host : Frontline
Plan : VPS Pro Linux
Operating system : Linux 2.6.9-023stab051.3-enterprise
CPU : GenuineIntel, Intel(R) Xeon(R)CPU E5345 @ 2.33GHz
Average load : 0.12; 0.10; 0.09


Hey, I have forgot to say about the CUP usage, when we login to our admin side (2-5) members the CPU usage reaches 170%.

We have used few joint queries in orders page and listed 100 results in one page (pagination).

And also, we have used curl to get the country details and country flag using the ip address from a third party website.

These are all the information that i know about the server, SSH - i am not familiar with the server side.

Please consider these information and give you suggestion how to stop the server crash.

Thank you.
If this is the company from where you get the server frontline .net/dedicated_linux_vsp.php then you dont seems to have Root Access.

You forget to answer to one question, this site was hosted from beginning on this Server and was working fine or you had shared hosting and then move the site on frontline ?

Also the CPU usage reaches 170% huh i never saw something like this and maybe somethings wrong there on server.

Did you tried to contact the support from frontline to see what its going on?
MariusPrice is offline  
Unread 29th Nov 2011, 11:18 AM   #6
VIP Warrior
 
mojojuju's Avatar
 
Join Date: 2005
Location: Potemkin Village
Posts: 1,724
Thanks: 745
Thanked 742 Times in 498 Posts
Default
Re: Need help with mysql optimization
Share on: 
fb share twitter share gplus share more share

Well one possible problem is that you're running Plesk on a VPS plan that has 256 MB RAM. The Parallels web site says that 512 MB ram is the minimum you should have to run Plesk. And you're also trying to run Apache+MySQL on top of that.

BTW, for $45/month, you're getting screwed if they're only giving you 256 MB RAM, unless they've got a primo network or something. You'd do better if you went just about anywhere else. Hostgator, which I haven't tried but everyone here raves about, will give you 768 MB of memory for less than $45/mo.
mojojuju is offline  
Unread 29th Nov 2011, 02:15 PM   #7
HyperActive Warrior
War Room Member
 
MariusPrice's Avatar
 
Join Date: 2011
Location: Sweden
Posts: 215
Thanks: 8
Thanked 74 Times in 43 Posts
Blog Entries: 4
Default
Re: Need help with mysql optimization
Share on: 
fb share twitter share gplus share more share

If you want to change your VPS there are the only two options that i use in last 4 years Managed Hosting for Smart Websites | ServInt | www.servint.net and aws.amazon.com EC2 on amazon i have a server and i pay about 14USD per month for 613 MB memory so if this is the site issue then get a better VPS
MariusPrice is offline  
Unread 30th Nov 2011, 12:46 AM   #8
HyperActive Warrior
War Room Member
 
ussher's Avatar
 
Join Date: 2010
Location: Tokyo
Posts: 314
Thanks: 27
Thanked 43 Times in 42 Posts
Default
Re: Need help with mysql optimization
Share on: 
fb share twitter share gplus share more share

why are you using mysql_pconnect() ? try mysql_connect() and see if that makes a difference.

Then setup a dev server with xdebug and get some stack traces.

Run your stack traces through kcachegrind and you will see all sorts of interesting things.

Sometimes small tweaks or oversights can result in huge runtime improvements. eg, i once found i had accidentally put a query inside a loop that didnt need to be inside the loop, moving it outside the loop resulted in a massive performance gain. kcachegrind will show you this kind of stuff.

"Jamroom is a Profile Centric CMS system suitable as a development framework for building entire communities. Highly modular in concept. Suitable for enterprise level development teams or solo freelancers."
- jamroom.net
Download Jamroom free: Download
ussher is offline  
Unread 1st Dec 2011, 04:53 PM   #9
HyperActive Warrior
War Room Member
 
MariusPrice's Avatar
 
Join Date: 2011
Location: Sweden
Posts: 215
Thanks: 8
Thanked 74 Times in 43 Posts
Blog Entries: 4
Default
Re: Need help with mysql optimization
Share on: 
fb share twitter share gplus share more share

Originally Posted by ram07 View Post

Hi every one,

I am in deep trouble with my client site, Often the server gets crashed. We have a dedicated server so that we can restart the server. Then its working fine.

By the time the server crash gets worse. I have found few things from the error log. Here are those,

1) [client 128.61.28.185] PHP Warning: mysql_pconnect():
Can't create a new thread (errno 12); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug in /httpdocs/includes/functions/database.php on line 18


2) [client 219.133.223.184] PHP Warning: mysql_query(): Too many connections /httpdocs/inc_rating.php on line 91, 97, 100, 106

3) [Tue Nov 29 00:08:26 2011] [crit] [client 122.164.131.157] (13)Permission denied: /httpdocs/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable, referer: /login.php

Site type : Oscommerce
DB size : 127 MiB
Control panel : Plesk

Please let me know if could find any solution on this. Awaiting for your replay.

Thank you.
I will try to help you, sent me a pm how i can be in touch with you, give me your skype if you have or Gtalk
MariusPrice is offline  
Closed Thread


Bookmarks

Tags
mysql, mysql_pconnect, optimization, plesk


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 On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 07:06 AM.