JohnDavisGH Posted March 9, 2023 Share Posted March 9, 2023 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! 1 Link to comment Share on other sites More sharing options...
JohnDavisGH Posted March 9, 2023 Author Share Posted March 9, 2023 (edited) 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 March 9, 2023 by JohnDavisGH (see edit history) 1 Link to comment Share on other sites More sharing options...
partiid Posted December 22, 2023 Share Posted December 22, 2023 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 More sharing options...
Msaustral Posted January 31 Share Posted January 31 Hi, we have successfully, after a year of testing, implement Prestashop on production, on real High Availability with vertical and horizontal scaling on Kubernetes Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now