Caching jobs

Scott James Remnant scott at netsplit.com
Mon Oct 22 21:48:34 BST 2007


On Mon, 2007-10-22 at 13:27 -0700, Shawn Rutledge wrote:

> I wonder if one of the worst unaddressed problems with conventional
> init scripts is the time it takes to spawn a shell for each one, and
> read the script from the disk.  Every time it is necessary to read a
> different file than the one you are already reading, there are more
> system calls and some seek time on the hard disk.
> 
This is probably mostly alleviated by readahead; we certainly found that
the time to execute the shell script was greatly larger than the time
taken to map it into memory -- part of the big speed-up of Ubuntu 7.04
was because we switched from bash to dash.

> Has any thought been put into an alternate binary "blob" format for
> the entire collection of jobs?  upstart could then read that single
> file into memory and blast through all of the jobs without reading
> anything else.
> 
Upstart's jobs aren't shell scripts like SysV, and are instead parsed
into memory just once on startup -- and watched with inotify for
changes.

The parser is a string one; so it could be faster by being binary ...
but it wouldn't actually buy you anything; you'd have to re-parse the
text files on boot to make sure they hadn't been changed while the
computer was off.

Scott
-- 
Have you ever, ever felt like this?
Had strange things happen?  Are you going round the twist?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/upstart-devel/attachments/20071022/b063592f/attachment.pgp 


More information about the upstart-devel mailing list