Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

My server is very slow

Status
Not open for further replies.

cihatkarli

Programmer
May 22, 2007
18
TR
I'm using centos 3. And have a Invision Portal forum installed on it.
I have 2GB DDR2 ram an p4 3.0 dual core cpu.
I had php4 and apache 1.x mysql 4 installed before and had same problems. Now i reinstalled the os and set up php5, apache 2 and mysql 5 to my server. But problems are still. My busy topics taking too much time to open and mostly timeouts. How can i diagnose what's causing this?
 
I use the `top` command to start. It will show the processes taking the most cpu and memory. It will also show the current resources. It keeps refreshing until you CTRL+C.

Once you've narrowed it down, look in /var/log/ for the apache2 and/or mysql logs. You can use `tail -f <logname>` to view the bottom of the file as it rolls.

If nothing pops out, look at the other logs.

Let us know what you find.

Mark
 
I have enabled slow query logs. And there's lots of random >10secs queries. Need more advices. Thanks for reply.
 
No. I'm not egyptian ><.

Random queries are the queries everytime forum does. Like read post, search something. Some of those queries are listed in slow query log.
 
You can also use vmstat to show info on CPU, memory and disk activity.
vmstat reports information about processes, memory, paging, block IO, traps, and cpu activity.
Code:
vmstat 1 60
gives you status every second for one minute.

HTH
:)


 
Look at the "WHERE" part of the slow queries. Can you index any of the fields they're trying to search on? That's usually the largest bottleneck.

Mark
 
Lot's of times with slow database behavior like this mysql's performance has not been optimized. You should really check the tuning tips for mysql and experiment. The default settings are NOT sufficient for a busy site.

Also be very sure you have disabled debugging for PHP and check your php.ini settings for harmful options.

HTH.
 
Here's an example

Date: Thu, 07 Feb 2008 12:54:40 +0200
Error Number: 2006
Error: MySQL server has gone away
IP Address: 85.105.161.141
Page: /index.php?showtopic=9992
mySQL query error: SELECT * FROM ibf_topics WHERE tid<>9992 AND approved=1 AND forum_id IN (1,19,6,13,25,36,56,41,65,2,3,4,5,55,10,7,12,8,60,11,9,72,71,18,64,16,14,15,17,20,22,21,23,48,24,51,34,67,35,68,32,54,37,40,38,39,42,63,66,43,44,45,49,52,57,58,59) AND (LOWER(title) LIKE 'tncxp%' OR LOWER(title) LIKE 'ile%' OR LOWER(title) LIKE 'ilgili%' OR LOWER(title) LIKE 'sorular%' OR LOWER(title) LIKE 'buraya%') ORDER BY last_post DESC LIMIT 0,5

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top