Litespeed Cache in /dev/shm

sahith

Well-Known Member
#1
I have successfully created lscache on /dev/shm which has half of the memory (16GB) allocated by default. But i am afraid of that 'lscache' folder will be deleted after server reboot.

I need help re-creating that 'lscache' folder in /dev/shm after reboot automatically with nobody:nobody permissions.

Please help me.

Thank you.
 

sahith

Well-Known Member
#2
I came to know i can create cron job using @reboot shellscript, but dont know how to create a shell script. Need Help.
 

sahith

Well-Known Member
#3
I created the following script

#!/bin/bash
mkdir -p /dev/shm/lscache
chown nobody:nobody /dev/shm/lscache


saved it as /usr/local/bin/lscache.sh

Then added cron job like

@reboot /usr/local/bin/lscache.sh

in /var/spool/cron/root

I dint tested it, But i guess it works. Please Let me know if anything i did wrong.

Thanks.
 

sahith

Well-Known Member
#4
LOL, I guess everything i did above is wrong. Because after server reboot , none of the websites worked. Even though lscache folder created in /dev/shm, it didnt worked. I had to create it again.

Please give me some inputs.

THanks.
 

NiteWave

Administrator
#7
that's enough after boot.

need create a cron job to delete expired cache under /dev/shm/lscache

/dev/shm is memory, if memory is full or near full, the whole server's performance will reduce greatly.
 

sahith

Well-Known Member
#8
that's enough after boot.

need create a cron job to delete expired cache under /dev/shm/lscache

/dev/shm is memory, if memory is full or near full, the whole server's performance will reduce greatly.
Yeah, I am already using cronjob for clearing cache from /dev/shm.

So it should be

mkdir -p /dev/shm/lscache
chown nobody:nobody /dev/shm/lscache


thats it right? what about permissions do i need to add 755 permissions also using
chmod 755 /dev/shm/lscache

???
 
Top