Jump to content

Has anyone Scaled Prestashop Horizontally succesfully ?


JohnDavisGH

Recommended Posts

Interested in hearing if anyone has successfully scaled Prestashop horizontally? Currently have 15k products and serving 80k users during peak sales.

Already maxed out our dedicated server.

Currently using LAMP stack.

How did you solve data synchronization between the DBs and files. How did you handle user sessions?

What LB did use?

Thank you!

  • Like 1
Link to comment
Share on other sites

I going to try creating a NFS server and have Prestashop server point to it to serve the files, if this is successful it could be a way to share files between multiple Prestashop servers. If anyone has done anything like this or has any advice please chime in. I could really use the help.

NFS has a simple client-server architecture that allows a server to export a directory to one or more clients, which can mount it as a local file system. This makes it easy to set up and manage shared storage for PrestaShop's files, such as product images, cache, and logs.

Procedure

Step 1: Install the NFS server package

Connect to the Ubuntu server as root via SSH or the console.

Update the package index & Install the NFS server package:

sudo apt update


sudo apt install nfs-kernel-server

Step 2: Create a shared directory

Create a directory to serve as the shared directory for PrestaShop's files:

sudo mkdir /var/nfs/share

Grant read and write access to the directory for the NFS clients:

sudo chown nobody:nogroup /var/nfs/share sudo chmod 777 /var/nfs/share

Step 3: Configure the NFS server

Edit the /etc/exports file:

sudo nano /etc/exports

Add the following line to the end of the file to export the shared directory to the NFS clients:

/var/nfs/share *(rw,sync,no_subtree_check,no_root_squash)

This line specifies that the directory /var/nfs/share should be exported to all clients with read-write permissions (rw), synchronous mode (sync), without checking for subtree changes (no_subtree_check), and without mapping the root user (no_root_squash).

Step 4: Restart the NFS server

Restart the NFS server to apply the changes:

sudo systemctl restart nfs-kernel-server

Step 5: Test the NFS server

Connect to each PrestaShop VM as root via SSH or the console.

Install the NFS client package:

sudo apt update sudo apt install nfs-common

Mount the shared directory on the VM:

sudo mount <nfs-server-ip>:/var/nfs/share /path/to/prestashop/folder

Replace <nfs-server-ip> with the IP address of the NFS server, and /path/to/prestashop/folder with the path to the folder where PrestaShop is installed on the VM. This command mounts the shared directory on the VM as a local file system, allowing PrestaShop to access the files in the shared directory as if they were stored locally.

To make the mount permanent, add the following line to the /etc/fstab file on the VM:

<nfs-server-ip>:/var/nfs/share /path/to/prestashop/folder nfs defaults 0 0

This line specifies that the NFS server should be mounted at boot time with default options.

Test the shared directory by creating a file in the directory on one PrestaShop VM and verifying that it appears on all other PrestaShop VMs that have mounted the directory.

Crossing my figners if this works

Edited by JohnDavisGH (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 9 months later...

Hello! 

On 3/9/2023 at 8:40 PM, JohnDavisGH said:

I going to try creating a NFS server and have Prestashop server point to it to serve the files, if this is successful it could be a way to share files between multiple Prestashop servers. If anyone has done anything like this or has any advice please chime in. I could really use the help.

NFS has a simple client-server architecture that allows a server to export a directory to one or more clients, which can mount it as a local file system. This makes it easy to set up and manage shared storage for PrestaShop's files, such as product images, cache, and logs.

Procedure

Step 1: Install the NFS server package

Connect to the Ubuntu server as root via SSH or the console.

Update the package index & Install the NFS server package:

sudo apt update


sudo apt install nfs-kernel-server

Step 2: Create a shared directory

Create a directory to serve as the shared directory for PrestaShop's files:

sudo mkdir /var/nfs/share

Grant read and write access to the directory for the NFS clients:

sudo chown nobody:nogroup /var/nfs/share sudo chmod 777 /var/nfs/share

Step 3: Configure the NFS server

Edit the /etc/exports file:

sudo nano /etc/exports

Add the following line to the end of the file to export the shared directory to the NFS clients:

/var/nfs/share *(rw,sync,no_subtree_check,no_root_squash)

This line specifies that the directory /var/nfs/share should be exported to all clients with read-write permissions (rw), synchronous mode (sync), without checking for subtree changes (no_subtree_check), and without mapping the root user (no_root_squash).

Step 4: Restart the NFS server

Restart the NFS server to apply the changes:

sudo systemctl restart nfs-kernel-server

Step 5: Test the NFS server

Connect to each PrestaShop VM as root via SSH or the console.

Install the NFS client package:

sudo apt update sudo apt install nfs-common

Mount the shared directory on the VM:

sudo mount <nfs-server-ip>:/var/nfs/share /path/to/prestashop/folder

Replace <nfs-server-ip> with the IP address of the NFS server, and /path/to/prestashop/folder with the path to the folder where PrestaShop is installed on the VM. This command mounts the shared directory on the VM as a local file system, allowing PrestaShop to access the files in the shared directory as if they were stored locally.

To make the mount permanent, add the following line to the /etc/fstab file on the VM:

<nfs-server-ip>:/var/nfs/share /path/to/prestashop/folder nfs defaults 0 0

This line specifies that the NFS server should be mounted at boot time with default options.

Test the shared directory by creating a file in the directory on one PrestaShop VM and verifying that it appears on all other PrestaShop VMs that have mounted the directory.

Crossing my figners if this works

Hello! Did it work for you? 
Have you found a successfuly scaled your prestashop? Please let me know! :)

Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...