No announcement yet.

Some tips on what to do if your site/server is slow

This topic is closed.
This is a sticky topic.
  • Filter
  • Time
  • Show
Clear All
new posts

  • Some tips on what to do if your site/server is slow

    These are just some general tips on what you can do/setup to optimize your server, whether it's with databases, apache or something else. These are in no particular order, so use whatever you think is necessary in your case.

    1. Try installing memcached/memcache to help with dynamic content and to take the load off of your database server. and

    Don't forget to configure /etc/sysconfig/memcached. Should look something like this:
    USER="nobody" (this should be the same as your webserver user (apache, etc..))
    To start memcached, use the following syntax, where 'm' is the memory it will use and -d means it will run as a daemon on port 11211 locally:
    memcached -d -u root -m 2048 -l -p 11211
    You can use the following init script to stop/start memcached easier: Just note the new memcached.conf configuration and path.

    Alternatively, it may be easier to simply install it using yum:
    yum -y install memcached
    - just use the rpmforge repo for this and that will get it setup automatically. Use the aforementioned variables for the /etc/sysconfig/memcached file.

    You can also check out the following post on how to get memcached and memcache setup and configured: - This is a good method

    2. Try running tuning primer on Mysql and make the necessary adjustments.

    3. Try running mysqltuner to get more details on what can be optimized within your mysql file.

    4. Try installing ELS script from servermonkeys. This will optimize/harden your server in several areas.

    5. Try installing mod_top and iftop. and

    6. Install EAccelerator with PHP to cache content and deliver it faster, thus taking load off of the server. and

    7. Try to run 'mysqlcheck -c -A' as root to fix any corrupted tables you may have. This will only work if you are using MySQL.

    8. It's also very possible that you have a large log file somewhere (2GB in size) that is causing this slowdown. To find it, run the following command for the directory you want to check (can just use / to check the whole root): find / -type f -size +1G

    There are certainly a lot more things you can do, but the above ones should atleast give you a good start.
    From Shared to Dedicated
    Professional. Painless. Polite.