Speeding up the SnapMerge
Hi Jamesbond
I tried s17 on my xo-1 olpc laptop and it does make a big speed difference. No problem so far after installing a couple of pets and deleting a few files.
Note that I am not having mavrothal's issue of devices not unmounting. Patriot's code is indeed in the rc.shutdown script. These are peculiar machines so it could be anything.
Cheers
I tried s17 on my xo-1 olpc laptop and it does make a big speed difference. No problem so far after installing a couple of pets and deleting a few files.
Note that I am not having mavrothal's issue of devices not unmounting. Patriot's code is indeed in the rc.shutdown script. These are peculiar machines so it could be anything.
Cheers
Puppy Linux Blog - contact me for access
The code is there (as Micko said) but it does a lazy umount. So if you have an ext3/4 formatted media you see that every time it recovers the journal (even if you add some time after the lazy umount for things to be written).jamesbond wrote:I thought Patriot has done this, and I'm sure that at least Fluppy, later version of Puppeee and Fatdog has this included. I'm not sure whether it makes it to the base puppy (woof) though.Now if someone can make puppy to umount the savelayer cleanly too...
I think Mick is using vfat, ext2 media thus does not see the problem, since as far as puppy is concerned the fsckme.err/.flg is removed already.
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==
Mplayer conflict?
Tried s-17 (in XOpup).
I do not know if this a bug or a feature but when gnome-mplayer is open snapmergepuppy freezes in the initial "merge requested" dialog.
Even if mplayer is paused or stopped or even without a file loaded.
Resumes when mplayer closes.
There is nothing in messages or xerrs.log indicative of a problem other than a process can not be found to be stopped and then restarted, at the "kill -STOP ${allprocess[$i]}" and "kill -CONT $i" step respectively. But this message has nothing to do with gnome-mplayer running or not.
For comparison, running a flash movie in the browser pauses no problem in snapmerge (and only as small freeze in flash).
I do not know if this a bug or a feature but when gnome-mplayer is open snapmergepuppy freezes in the initial "merge requested" dialog.
Even if mplayer is paused or stopped or even without a file loaded.
Resumes when mplayer closes.
There is nothing in messages or xerrs.log indicative of a problem other than a process can not be found to be stopped and then restarted, at the "kill -STOP ${allprocess[$i]}" and "kill -CONT $i" step respectively. But this message has nothing to do with gnome-mplayer running or not.
For comparison, running a flash movie in the browser pauses no problem in snapmerge (and only as small freeze in flash).
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==
You probably have an old version of the shutdown script.mavrothal wrote:The code is there (as Micko said) but it does a lazy umount. So if you have an ext3/4 formatted media you see that every time it recovers the journal (even if you add some time after the lazy umount for things to be written).jamesbond wrote:I thought Patriot has done this, and I'm sure that at least Fluppy, later version of Puppeee and Fatdog has this included. I'm not sure whether it makes it to the base puppy (woof) though.Now if someone can make puppy to umount the savelayer cleanly too...
I think Mick is using vfat, ext2 media thus does not see the problem, since as far as puppy is concerned the fsckme.err/.flg is removed already.
Patriot's code looks like this and does work:
Code: Select all
if [ "$SAVE_LAYER" ];then
sync
SAVEDEV="`mount | grep "/initrd${SAVE_LAYER}" | cut -f 1 -d ' '`"
SAVEFS="`mount | grep "/initrd${SAVE_LAYER}" | cut -f 5 -d ' '`"
#100615 Patriot: suggested this code to enable save-layer to remount ro...
uniFS=$(awk '/unionfs/ {print $3}' /proc/mounts) #ex: aufs
if [ "$uniFS" == "aufs" -a "$SAVE_LAYER" == "/pup_rw" ]; then
#i think only work if prepended dir is a separate f.s...
if [ "`mount | grep '^tmpfs on /tmp '`" != "" ];then #created in initrd.
mkdir -p /tmp/unrootfs
busybox mount -o remount,prepend:/tmp/unrootfs,xino=/tmp/unrootfs/xino -t $uniFS / /
sync
fi
fi
busybox mount -t $SAVEFS -o remount,ro $SAVEDEV /initrd${SAVE_LAYER} 2>/dev/null
umount-FULL -i -n -l /initrd${SAVE_LAYER} 2>/dev/null #-l is lazy unmount.
fi
I'm going to start a new save file and try to run in pupmode 13 for a few weeks and see how it goes.jamesbond wrote:Didn't incorporate your suggestion yet - I was working on it, finished it and then see your post.
Anyway - here is s17 - modularised version of s16.
Changes -
1) warn user based on size of tmpfs and number of files in tmpfs (I included both because I'm not sure which steps causes the slow down)
2) modularised the functions
It still works as before (ie pauses the whole process), but I've separated the freeze function, snapmerge function, and cleanup function. It will be easy to change so that it will only freeze during cleanup. Look at line 204 - just move the freeze_processes in-between snapmerge and cleanup.
If we can confirm that the slowdown is because of tmpfs deletion, then there's not point in doing this. But if the slowdown is because rsync - ok perhaps it's worthwhile to take additional risks for shorter freeze time.
Let me know.
Oh yes the warn_user limit is arbitrary - it really depends on how slow things are. I'll take your feedback on this. Currently I set the limit to 64MB and 1000 files.
cheers!
[url]http://saluki-linux.com[/url]
Actually this the the exact code I have and it works in the sense that shuts down the XO. The "problem" is that is doing it after a lazy umount of the save layer.jemimah wrote:mavrothal wrote:You probably have an old version of the shutdown script.
Patriot's code looks like this and does work:
The "busybox mount -t $SAVEFS..." step reports "mounting /dev/mmcblk0p1 on /initrd/pup_rw failed: Device or resource busy"
Oh well, maybe is an XO specific issue
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==
Re: Mplayer conflict?
Hmm that's odd. How about this - open gnome-mplayer, and then open terminal, and run "snapmergepuppy" from terminal and tell me what you see. If everything works, the problem is elsewhere (snapmergepuppy is just the last chain of command that do the actual work, there are other scripts that work). If snapmergepuppy never finishes, (and you can press Ctrl-C to break out of it) - hmmm I need to think hardermavrothal wrote:Tried s-17 (in XOpup).
I do not know if this a bug or a feature but when gnome-mplayer is open snapmergepuppy freezes in the initial "merge requested" dialog.
Even if mplayer is paused or stopped or even without a file loaded.
Resumes when mplayer closes.
There is nothing in messages or xerrs.log indicative of a problem other than a process can not be found to be stopped and then restarted, at the "kill -STOP ${allprocess[$i]}" and "kill -CONT $i" step respectively. But this message has nothing to do with gnome-mplayer running or not.
For comparison, running a flash movie in the browser pauses no problem in snapmerge (and only as small freeze in flash).
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]
I can have a break for a whilejemimah wrote:I'm going to start a new save file and try to run in pupmode 13 for a few weeks and see how it goes.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]
Re: Mplayer conflict?
You are actually right.jamesbond wrote:Hmm that's odd. How about this - open gnome-mplayer, and then open terminal, and run "snapmergepuppy" from terminal and tell me what you see. If everything works, the problem is elsewhere (snapmergepuppy is just the last chain of command that do the actual work, there are other scripts that work). If snapmergepuppy never finishes, (and you can press Ctrl-C to break out of it) - hmmm I need to think harder
Is pup_event_frontend_d that does not allow merges by default when mplayer (and other apps) are open. However, save2flash does run and you end up with a hung warning screen.
Snapmergepuppy is fine
Get your rest
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==
s18 - fix for those running bash version 4 (e.g. fatdog). For those not using bash4, there is no need to upgrade.
cheers!
cheers!
Last edited by jamesbond on Tue 01 Mar 2011, 11:06, edited 1 time in total.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]
s19 - use --force option for rsync to make sure that it we replace a directory with a symlink at the top layer, this will be rsync-ed down to the save layer.
I'm cleaning up and removing all the old versions.
I'm cleaning up and removing all the old versions.
- Attachments
-
- snapmerge-19.pet
- (97.78 KiB) Downloaded 449 times
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]
Been eating my own dogfood for a week now, running this on 1GB pupsave file on top of 16GB ext3-formatted flash. I bumped up the size of the warning from 32MB in the script to 128MB as I don't notice a delay during merge.
So far looks okay, no data loss, no odd behaviour, etc.
cheers!
So far looks okay, no data loss, no odd behaviour, etc.
cheers!
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]
The story three weeks later - so far so good. The save is almost always instantaneous - for 200MB worth of data (this is on a 4GB machine - so it appears that the kernel manage to cache most of it - different machines may fare differently). The delay however is apparent when we do "sync".
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]
-
- Posts: 3
- Joined: Thu 13 Nov 2014, 18:33
rsync options in SnapMerge
I have a 700MB save file in Puppy Precise 5.7.1, with the normal collection of small files, plus a 200 MB TrueCrypt container file (and yes, I am following replacement options for the now possibly insecure TrueCrypt).
Downloaded and installed snapmerge-19.pet, to see if it would speed up shutting down (and saving) Puppy.
Some improvement in save time, but not dramatic.
Googled rsync, discovered that when copying to/from a remote connection, rsync copies only the changed portions of files, dramatically speeding the copy process. BUT, when copying locally (as in saving Puppy session from ram to my save file) rsync defaults to copying everything, not just changed portions of files. So slightest change in my 200 MB TrueCrypt volume (file) causes a 200 MB copy!
So I modified snapmerge's rsync to have the additional parameter '--no-whole-file'. This tells rsync to only copy changed portions of files, always, on local system copies, as well as being the default on remote copies.
The result of '--no-whole-file' is amazing, cutting my save time in half, or even less if file changes during my session have been minimal!
My question: Is this '--no-whole-file' modification a great idea, or will there be unanticipated consequences that will make me wish I had never made this change???
Downloaded and installed snapmerge-19.pet, to see if it would speed up shutting down (and saving) Puppy.
Some improvement in save time, but not dramatic.
Googled rsync, discovered that when copying to/from a remote connection, rsync copies only the changed portions of files, dramatically speeding the copy process. BUT, when copying locally (as in saving Puppy session from ram to my save file) rsync defaults to copying everything, not just changed portions of files. So slightest change in my 200 MB TrueCrypt volume (file) causes a 200 MB copy!
So I modified snapmerge's rsync to have the additional parameter '--no-whole-file'. This tells rsync to only copy changed portions of files, always, on local system copies, as well as being the default on remote copies.
The result of '--no-whole-file' is amazing, cutting my save time in half, or even less if file changes during my session have been minimal!
My question: Is this '--no-whole-file' modification a great idea, or will there be unanticipated consequences that will make me wish I had never made this change???