I do not understand why since some month my Slax is slowing down. I just checked now and discovered that on my 2 Gb RAM (no swap partition) I have a cache size of 830 Mb - a Hard disk temp of 150 Mb and 30 % for the applications data. It means it left only 3 to 12 % of physical RAM.
Then how can I get a system more reactive (I presume by regularly reducing the cache use) ?
It'd be worth trying to make a bleachbit module from another distro--bleachbit should really help you out. But here are a few tips I could offer, really. They aren't the best, but they'll work. Go into Konqueror, Firefox, and other apps that you use often and clear out the history, cache, etc. Go to your home folder in Konqueror. Clear out the cache that is stored in different . directories (you can see them by showing hidden files). Add a swap file (dump /dev/zero to a file with dd and specify a size--we'll say 3 GB in this case (1.5 swap rule x 2 GB RAM) and then just do mkswap your_swap_image && swapon your_swap_image.) See your /var folder and any temporary directories to apps you have added--with caution, try seeing what you can do in there. I can't see your system, so... it will definitely be different from, say, mine. If you have any junk files lying around, back up and remove them. If you don't need them at all, delete them.
Finally, it wouldn't hurt to do a disk check. Go ahead and see if you can do a fsck (filesystem check) command on your drive. If it's a question of fragmentation (we don't really discuss this in the Linux world, but I can prove it happens), then back everything off and reformat your drive. This is more likely to happen with fat32--the ext filesystem should be resilient to that for the most part.
And, also, doing free sometimes will yield back shocking results, such as an equivalent of 202 MB RAM used in blocks of 256 MB RAM, so if this is happening and Slax is running properly, I'd stick with using a swap partition or file. Otherwise, I'd seal up any leaks and work on getting files under control.
That's about all I can say for now you help you in this situation. Good luck; hope this helps solve your situation. :)
For one thing, in your dd instructions, you're putting the file at /. I'd suggest you assign somewhere where it wouldn't be in the unionfs, like /mnt/sda1 for your hard disk. And... I might chime in you really shouldn't need to use the filesystem table, but you could if you really wanted to, of course--I would actually make a script to turn it on (swapon) in autoexec personally--but it's up to you. The reason I mention that is because Slax is a "live" filesystem, and if something went wrong with /etc/fstab, you wouldn't be able to boot properly. If it were me, with the swap, I'd do:
dd if=/dev/zero of=/mnt/sda1/swapimage.img count=2048000 (should give me 1.0 GB swap, if I remember right--I'll have to double-check... note I didn't account in block sizes and didn't want to) mkswap /mnt/sda1/swapimage.img cd /mnt/sda1 && swapon swapimage.img, and from there:
echo "\
#!/bin/bash
#
# Free script to turn on swap in Slax
you right about the fact to not specify it in the fstab but well using a script. Thanks to have remember it to me.
Just one thing where in the begin of your command line instruction when you wrote :
swapon /mnt/sda1/swapimage.img" ...
As you can see there is e " just after the .img then I presume it must be one first to start the sentence ?
I presume you though given this
"swapon /mnt/sda1/swapimage.img" > swapscript.sh && chmod +x swapscript.sh
Just to be sure to share the good information.
Sincerely thanks and have a nice day,
As you already know, these are bash commands we feed to a shell, or a terminal app like Konsole. Some people use cat to quickly write files out, but in this case, I used echo. We start with echo "\, which means we want to use multiple lines and add the #!/bin/bash bit on the next line. Anyway... at the very end of the script, there will be one more " and that's the closing part that tells bash that we're done writing the file.
And the > tells bash to write all this to swapscript.sh, even if it didn't exist. (As an added bonus, && tells it if "echoing" went well, then make it executable.) :) Things should have looked close to this:
root@slax# echo "\
> #!/bin/bash
> #
> # Free script to turn on swap in Slax
>
> echo 'Turning on swap...'
> swapon /mnt/sda1/swapimage.img" > swapscript.sh && chmod +x swapscript.sh
root@slax# exit _
Now, if you really want to, you can use cat, or you can use the vi text editor.
Not sure if that answered everything, or if that was too much. :) But I hope it helped.
I apologize for this bad remark concerning the alone " I though you forgot the starting ".
I did not made enough attention to the fist opening ".
But with you perfect explaination now I now this new way to fill a bash file. I still know the cat but did not know the echo way. Now I am minus stupid ;-) Thanks to have teached me this way.
I will try it this week-end and hope it will be better for my current system latency problem.
I well made the swap file as explained. I just used a count=3072000 and got 1,46 Gb of swap file.
I activated it (run the ./swapscript.sh) in my rc.M
But even if I used a bash to delete all undesired (cache) files I still have a cache of 54 % (and then only 4 % both in the physical memory).
Sorry to tell it like this but where is this F***ing cache I need to clear to get more memory.
Here is the automatic bash I run when I shutdown the system (and the same action for all users on the /home/ as done here for the root account).
Sincerely thanks for your help and have a nice day,
Miguipda ;-)
Bash script file I though was enough to clear cache :
rm -r /tmp/*
Thanks for posting the script--I'll see if I can get to that. For now, and I'm only asking to help clear things up--what happens on you start Slax in Always Fresh mode? I just want to see if anything is plugging up your system, or if Slax boots this way by default (in which case cleaning out caches won't solve much, if anything.)
One last thought from earlier:
And, also, doing free sometimes will yield back shocking results, such as an equivalent of 202 MB RAM used in blocks of 256 MB RAM, so if this is happening and Slax is running properly, I'd stick with using a swap partition or file. Otherwise, I'd seal up any leaks and work on getting files under control.