-
Harddisk spin-up delay [solved, I think]
Hi
I have a security cam watched by a computer with Motion. on that computer i use hdparm -S 240 /dev/hdb to stop the harddrive where the pictures go from running when not used (witch is usually 2 days in a row).
Now when motion is detected, the first 3 or 4 pictures are saved, and then there is a pauze for about 5 sec. before the next picture. This has to do with the hard-disk spinning up (I tried without), but I don't understand why not more pictures are held in memory until the disk is ready.
Has anybody ideas how to solve this without having the disk running all days?, or what i should start reading
motion (version 3.2.9)
Debian lenny
Kernel 2.6.26-2-686
hdparm v8.9
PII with 384mb ram
pictures are jpg size 30-70kb
Code:
server:~# free
total used free shared buffers cached
Mem: 386244 381432 4812 0 145952 102416
-/+ buffers/cache: 133064 253180
Swap: 257000 924 256076
Last edited by folkert; 04-18-2010 at 05:06 AM.
-
Possibly you need more memory!!!!
-
Perhaps you could have the pictures saved to a ram disk then run a script to monitor the ram disk for new pictures and move them to your hard disk.
-
Which filesystem are you running? Some of them are more aggressive about caching than others so that may have a big effect on this sort of thing. For example, I think ext4 tends to cache small writes for quite a while (30 seconds or more) just in its normal operation. You might even be able to tweak that if it takes longer for the hard drive to spin up.
-
Cybertron, I believe it is ext3, but I can't look at it right now. I guess I could start reading about tune2fs
I started to run /bin/sync as soon as motion is detected (on_event_start in motion.conf) and it seems to start up the disk fast enough to not have the problems. I will watch if it keeps working for a while.
thank you all
-
Ah, interesting. The problem must have been that the disk didn't start to spin up until it actually wanted to write the cached data, rather than when data started getting cached. Glad to hear you got it working.
-
run /bin/sync as soon as motion is detected
Oke, that seemed not to help most of the times.
I now modified /proc/sys/vm/dirty_ratio witch was at 10, and now I made it 40 so the program won't be locked to write the pictures to disk so soon.
I tested once with succes, but will be watching it functioning closely for a while. (problem is that the situation only 3 or 4 times a week happens)
Last edited by folkert; 04-22-2010 at 06:24 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|