0

I am new to server management and earlier I used shared hosting and thought to go for VPS and get more for my websites. VPS specs:

RAM: 12GB
CPU: 4 Core Intel E5
SSD: 300GB
Server: Apache
OS: Ubuntu 16.04
PHP: 7.0 FCGI
Stack: Virtualmin
Script: Wordpress
Number of website: 1(Going to host 5 more websites if server can withstand with it)
Cache plugin: W3 Total Cache

I installed memcached on my VPS and want to tune it to serve static file at faster rate. Since I don't know what can be done so I have included my memcached file:

# Run memcached as a daemon
-d

# Log memcached's output to /var/log/memcached
logfile /var/log/memcached.log

# Start with a cap of 4096 megs of memory
-m 4096

# Default connection port is 11211
-p 11211

# Run the daemon as memcache
-u memcache

# Specify which IP address to listen on.
-l 127.0.0.1

Reason for tuning: Better performance and when running 5 WordPress sites. I purchase popup traffic which is 1000-3000 per 1 minute. So, I want to server each page from memcached and I want to know if there's some tuning needed for this

Please let me know what can be done in order to tune up my website.

ThoriumBR
  • 5,272
  • 2
  • 23
  • 34
  • Can you add some information about what is needing improvement? Current statistics, future expected loads per day, etc. would be useful. – Cory Knutson Dec 21 '17 at 18:28
  • Reason for tuning: Better performance and when running 5 WordPress sites. I purchase popup traffic which is 1000-3000 per 1 minute. So, I want to server each page from memcached and I want to know if there's some tuning needed for this – Prashant Verma Dec 21 '17 at 19:09
  • Memcached won't help serving static files, it only helps with dynamic content. – Tero Kilkanen Dec 21 '17 at 21:12

1 Answers1

1

Usually questions on "How to tune" depends heavily on a lot of moving parts, and unless the default settings are very wrong, don't have a definitive answer. You will have to find the answers yourself. And probably your performance issues are on the database or webserver, not on memcached.

The best way to achieve the best tuning is to test, measure, optimize, test, measure, optimize, and repeat. Unless you can define where the bottlenecks are, no optimization will improve the performance.

For example, you allocated 4Gb for memcached. Unless you could determine that memcached was suffering because of lack of memory, the performance will not increase and you potentially diverted memory that would probably help the database or web server, probably hurting the performance.

Before any optimization, run a series of performance tests to create a baseline. This is very important, and without a solid baseline you cannot say for sure if any optimization is improving the performance at all. Return all config files to the defaults, restart the computer, and stress test it. Use any good load generator (Apache JMeter is a good one), create a test case, and run the test for a reasonable time. A good test case can be built by looking at your webserver log files.

With the baseline in hand, use performance monitoring tools to see where your server is seeing more demand. iostat, vmstat, iotop, monit and nmon are your friends here. You can see if your system is taking much time doing disk IO, or if you have too little RAM, or if the network is the problem.

When you know where are the problem areas, you can start optimizing. You can increase memory to the database and decrease for the webserver, if you see that the database caches are low. Or increase the number of webserver processes if you see that the webserver queue is high.

After changing any of the system parameters, run the same tests again. Don't change any parameter of the test. If the performance is better, you have a new baseline. Check the performance meters again, try to identify another bottleneck, rinse, repeat.

Performance tuning is an iterative process, not a task.

ThoriumBR
  • 5,272
  • 2
  • 23
  • 34