What is the best server configuration for online stores?

Hello to all Linode users :)

I am new in the community and this is my first topic and i want to thanks in advance to all users that will help me.

I came from shared hosting and i am a totally newbie working with VPS :roll:

I need to know what is the best solution to host several online stores with a fast and stable server.

The onlines store will be exclusively from Prestashop platform.

Currently i have the start Linode plan in order to test and see if i can achieve a fast and stable server 8)

For the moment i don't have any public store to host with thousands of visit per day, but i hope that i will have in the near future.

For test proposes i will have one online store with about 40000 products and 80000 pictures ore more. Normally the online store will not show more than 20 products per page.

I will want a server that can load the online store with many pictures and scripts in about 2 seconds!!!

Feel free to ask for more information, if you need to help me with the best server configuration :wink:

10 Replies

work out how much space your pictures/products will take keeping in mind how Prestashop caches copies and scales images (assuming it does - I've never used it). Then choose the best Linode size based on space.

I wouldn't start worrying about performance until you start to have 1000s of requests every 10-20 mins. Before you get there buy some professional help. You should be able to afford it then.

Your response time of 2 seconds is going to be affected by html/css layout more than any aspect of server configuration.

One of the most important things you can do is appropriately set up your web server and database server for the amount of RAM that you have. If you're using Apache's default configuration (mpm_prefork), at the very least you'll want to change your MaxClients from the default. Looking into If you have 1GB of RAM, then 25 might be a good starting point, tweaking up or down from there. This is the maximum number of simultaneous connections. Unless you have long-running connections (certain types of AJAX webapps may, but not all), this doesn't need to be too high. Your server can only do so many things at the same time, so letting a huge number of people be served simultaneously just slows everything down and burns through RAM.

To help keep the number of simultaneous connections under control, you'll also want to disable keepalives, or at least set it to only one or two seconds (low enough to prevent clients from hogging idle connections, but high enough to allow a client to work through a queue without reconnecting).

The alternative is to move Apache to mpmworker, which also requires you to set up PHP in a different way (instead of modphp). This gets a bit more technical, though, so for a user starting out, tweaking the defaults is a much easier approach (since you just have to change one or two numbers in the config file and that's it).

Another thing is to make sure you configure MySQL appropriately for the amount of RAM you have. This is pretty easy, because there are a bunch of pre-made config files you can start with. The files you're probably interested in are my-medium.cnf or my-large.cnf (look at the header of the files for descriptions about how much RAM they are appropriate for). I think they're somewhere in /usr/share/doc/mysql-server-5.0/examples/ or something like that. You would replace the existing config file with one of those. They're a pretty decent starting point. I'd say use my-medium if you have 512MB of RAM, and my-large if you have 1024MB or more RAM.

@danblack

My problem now is not the space that photos will use in this online store that i will use, only for testing purposes, but for information it will be about 1.5GB .

You must horry with performance from the begin, because customers like fast shops, not slow shops.

Think by yourself… do you like to browse a slow site? if you have to choose from 2 sites to buy the same product, with the same price you will choose the faster one or the slow one?

The code is important, but the server is also very important… for example some people says that nginx is must more faster then apache. If you have a server with ssd disks it will be much more faster ;)

@guzpaz

I will try to follow what you said, can you point me any good tutorial for install and optimize apache server with php, mysql and phpmyadmin for low memory… currently i only have 512MB.

Thank for both of you for the reply's 8)

Once you've installed the basics run google page speed on your site it gives various good recommendations. Images are often the slowest part of a site compressing them using jpegoptim and optipng can make a big difference.

I know that i have to optimize the images and i have done that, i just don't know the programs you have mentioned ;)

Next days i will try that programs…

Thanks for your advice and suggestion ;)

You can just use Yahoo's smushit:

http://www.smushit.com/ysmush.it/

It basically just runs a variety of image optimization tools on your image to losslessly reduce their size. It's convenient because it does it all for you.

I have a cron job on image heavy sites that scans the media directories and optimises the files in place. That way any thumbnail or other cached files the system creates are optimised, magento has a tendency to create a lot of these files.

@Guspaz

@obs

Many thanks for your tips regarding script and images optimization.

You have point me some tools that i haven't tested yet ;)

I am a junior developer in the beginning and Moderator from Prestashop since 1999, so have some experience with the script and is optimization.

What i want now is to make a very well optimized server for Prestashop stores only.

I prefer that the reply don't go out from the topic title, that is try to find the best server configuration to run online stores.

Beside this if anybody can point also specific optimizations for a specific server configuration to Prestashop online stores, this will be very nice :D

Best Regards,

These tips aren't specific to presta but stores in general

1. On static resources set the expires header to something long (if you're using nginx you can use expires max;)

2. Enable GZIP compression

3. If you use nginx you can use the fastcgi cache options to cache copies of your pages reducing how many pages hit your php back end

4. If you're using apache and mpm worker turn keep alives off lower your max clients 10's probably a good start for a Linode 512 but your mileage may vary.

5. Run mysqltuner.pl perodically to keep an eye on your MySQL server i.e. query cache size.

6. Use innodb if you can for your database tables it recovers from crashes must better than myisam.

7. Document what you do, at some point in the future you'll need it and the odds are you'll forget what you did

8. Have a solid backup system you test regularly

This is the kind of tips i was expecting… like @Guspaz have made before in is first topic and the one you @obs have made in your last post :D

But unfortunately i will say goodbye to Linode…

Thanks for all of you that have try to help me.

Best Regards

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct