we are using gulp in laravel to minify our views, the problem we are facing, server is unable to process gulp due to low ram of 512, is there any way we can minify the html on our local machine and then push it to our server?
-
Can't you perform gulp on your local machine? – LC Yoong Mar 08 '17 at 10:10
-
I can, but when i upload specific views files on server, laravel crashes, m'i suppose to push all files? – fewBugs Mar 08 '17 at 11:33
-
Try to debug which file causes the 'crash'. The right way is to gulp on local and push to live/staging etc. – LC Yoong Mar 08 '17 at 15:07
1 Answers
I think you should solve this by making a swap space on your server.
Swap files increase the amount of virtual memory available to perform tasks like for example gulp.
Linux divides its physical RAM (random access memory) into chunks of memory called pages. Swapping is the process whereby a page of memory is copied to the preconfigured space on the hard disk, called swap space, to free up that page of memory. The combined sizes of the physical memory and the swap space is the amount of virtual memory available.
from: https://wiki.archlinux.org/index.php/swap
Depending on what your server setup looks like you can find many guides on how to enable swap for your particular server.
Assuming you have Linux you can check if your server has any swap space allocated by running:
sudo swapon --show
and also
free -h
To create a swapfile you allocate it by:
sudo fallocate -l 1G /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
Which will give you a swap file of 1 GB.
You then have to secure the swap and configure swappiness etc for performance and this depends on your system.

- 1,558
- 3
- 14
- 29