LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-21-2011, 01:14 PM   #1
zahirw
LQ Newbie
 
Registered: Apr 2011
Posts: 2

Rep: Reputation: 0
Server Slow : Apache Mysql fine tuning


I'm running a linux cloud server with the following config
1.2ghz Processor allocation
752MB Ram

The site loads slow and clicking a link almost freezes the page for a second. Also, the page loads could be much faster. We've been running mysqltuner and have pretty much optimized all slow queries. Is there anything we can do to fine tune the server for faster and more responsive?

Httpd.conf

Timeout 20
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 5
<IfModule prefork.c>
StartServers 2
MinSpareServers 1
MaxSpareServers 5
MaxRequestsPerChild 4000
ServerLimit 256
MaxClients 256
</IfModule>

---

my.cnf

[mysqld]
datadir = /var/lib/mysql
socket = /var/lib/mysql/mysql.sock
user=mysql
log-error=/var/log/mysqld.log
log-slow-queries = /var/log/mysql-slow-queries
query_cache_size=16M
old_passwords=1

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
 
Old 04-21-2011, 05:46 PM   #2
cmnorton
Member
 
Registered: Feb 2005
Distribution: Ubuntu, CentOS
Posts: 585

Rep: Reputation: 35
Things To Try

Unless your hardware is an ancient desktop, probably clicking on a link should not freeze anything. It was helpful when you said on load, because I've poorly designed queries that took to long to execute, and had to correct them.

Have you executed top to see what else is running?

Is there any evidence of anything going on in MySQL's or Apache's logs (/var/log/...) ?

Have you searched for MySQL tuning like this
[URL="http://dev.mysql.com/doc/refman/5.0/en/server-parameters.html"]
 
Old 04-22-2011, 02:26 PM   #3
Bodi
LQ Newbie
 
Registered: Jul 2009
Posts: 25

Rep: Reputation: 2
Hello,

Here are some of the suggestions that I can give you :

1. Run top and see which process is consuming the most CPU and Memory.

2. As far as I see from your Apache config file, you are using Apache prefork mode. You can try installing(compiling or with apt-get) Apache with worker mode and fastCGI for PHP. I believe on older PCs, websites run faster on Apache with worker mode and fastCGI.

Here is an article how to install Apache with worker mode and fastCGI from apt-get :

3. Try using memcached for your server. ( You can find a lot of information about that on Google )

Here are some example articles for installing memcached for PHP, MySQL and the memcached daemon :

This will help you install memcached daemon and set it up to work with MySQL.

Here you can find how to install memcached extension for PHP and how to compile the memcached daemon from source code.

I hope this helps
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache Server maxclient/serverlimit perf Tuning helptonewbie Linux - Server 3 04-01-2010 09:54 AM
Mysql Optimisation/fine tuning shii_va Linux - Server 1 09-23-2009 12:18 PM
Linux-Apache Fine Tuning for Mod_Perl Full Time Staff Needed-Telecommute mkevitt LQ Job Marketplace [Archive] 5 07-12-2009 05:13 AM
Samba Server Authentication Fine Tuning mannahazarika Linux - Server 1 09-01-2006 04:35 PM
Apache & MySQL keep becoming unresponsive, tuning? chotgor1 Linux - Software 2 11-03-2004 01:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration