Tuesday 4 February 2014

Re: On-demand starting/stopping of cups [was: [Blueprint client-1305-printing-stack-with-mobile-in-mind] Printing Stack with Mobile in Mind]

On Tue, Feb 04, 2014 at 04:53:51PM -0500, Luke Faraone wrote:
> On 4 February 2014 12:21, Oliver Grawert <ogra@ubuntu.com> wrote:

> > i personally just don't get why we cant make cups stop even on the
> > desktop unless the machine is an actual printserver, the additional
> > startup time will be minor on a modern desktop/laptop PC. i doubt people
> > would even notice that their print job takes a few seconds longer than
> > it would with a permanently running daemon.

> I would. I use my Ubuntu laptop at home, work, and school. I need to
> print in all three of those contexts, the latter two more often than the
> first. Unless the startup time is on the order of 5 seconds on
> reasonable hardware, and the user is made aware of what is going on,
> there is going to be a degradation of user experience.

# time restart cups
cups start/running, process 9515

real 0m0.580s
user 0m0.003s
sys 0m0.003s
#

I don't think there's actually anything to be concerned with here wrt cups
server startup time on ordinary desktop hardware. In fact, given that
on-demand startup implies socket activation, and the polling in the current
cups post-start script is a workaround for lack of service readiness
notification in cups that will go away with socket activation, cups startup
time should be all but unnoticeable.

> If CUPS doesn't even start until a half-minute after I thought I hit
> "print" (before which I didn't have a print icon in my notification
> area), I'm going to think something's broken with my system. If after
> that, CUPS tries for a minute or so and determines eventually my printer
> is not connected, I'm now so far away from the document I was originally
> working on that I'm entirely lost.

> On my laptop right now, CUPS appears to be taking up a whopping 3.5MiB,
> and has been active for a total of 45 seconds of CPU time in the last
> three days. I'm not really clear on why this is an amount worth losing
> sleep over.

Not sure how you're measuring the memory usage; on my amd64 system in
trusty, smem reports:

PID User Command Swap USS PSS RSS
9515 root /usr/sbin/cupsd -F 0 6404 6584 9004

So that's more than 3.5MB. Still not much to be concerned about on a
desktop, but OTOH there doesn't seem to be much cost to making cups
on-demand on the desktop either. And if we're doing this on the phone
anyway (where memory pressure is much more of a concern), then it's worth
considering whether this change makes sense on the desktop too even if it's
not a high priority in its own right there.

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
slangasek@ubuntu.com vorlon@debian.org