Re: jail process limits

2008-05-24 Thread Kris Kennaway
On Thu, May 22, 2008 at 03:26:13PM -0400, Vivek Khera wrote:
> While we're on the topic of jail resource limits, I think I'll ask my  
> question again...  I asked last month but got no response...
> 
> 
> I've got a jail server (FreeBSD 6.3/amd64) which runs a bunch of web  
> site development environments.  There is an apache or lighttpd running  
> in each jail as user httpd (same UID on base system and each jail).
> 
> On the jail host, I counted 231 processes owned by httpd.
> 
> If I try to start an application server (or any process) as user httpd  
> in one of the jails, it exits immediately with "Cannot fork: Resource  
> temporarily unavailable".  Even if I "su httpd" I get the same error  
> on any command I try to run such as "ls".  If I run the same on the  
> jail host, it has no problems.  The jail itself only has 34 processes  
> running.
> 
> On the jail host, the following is logged:
> 
> Apr 22 16:34:38 staging kernel: maxproc limit exceeded by uid 80,  
> please see tuning(7) and login.conf(5).

> Can anyone tell me where to look to find out what is limiting user  
> httpd from creating new processes inside the jail, and what exactly  
> that limit is?  More importantly, how to increase it.

I'd start by instrumenting the code path that leads to the above
kernel printf, to try and differentiate any possible causes.

Kris

--
In God we Trust -- all others must submit an X.509 certificate.
-- Charles Forsythe <[EMAIL PROTECTED]>
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: BTX loader hangs after version info

2008-05-24 Thread Peter Holm
On Fri, May 23, 2008 at 06:11:01PM -0400, John Baldwin wrote:
> On Friday 23 May 2008 09:26:45 am Kostik Belousov wrote:
> > On Fri, May 23, 2008 at 08:29:09AM -0400, John Baldwin wrote:
> > > On Friday 23 May 2008 07:53:11 am Kostik Belousov wrote:
> > > > On Fri, May 23, 2008 at 01:22:55PM +1200, Mark Kirkwood wrote:
> > > > > James Seward wrote:
> > > > > >Hello,
> > > > > >
> > > > > >Two days ago I csup'd my desktop at home, which was running RELENG_7
> > > > > >from about 7.0-RELEASE time, to bring it up-to-date (still on
> > > > > >RELENG_7). I followed my usual buildkernel/world procedure (the usual
> > > > > >one) which has worked fine all the way since 5.x. After installing
> > > > > >kernel and restarting in single user, it was working fine. However,
> > > > > >following installworld it will not boot.
> > > > > >
> > > > > >It stops immediately after "BTX loader 1.00 BTX version 1.02", but
> > > > > >with the cursor on the line *above* the first "B". Nothing futher
> > > > > >happens, but the system responds to Ctrl-Alt-Del.
> > > > > >
> > > > > >I have managed to start it using the install CD and csup'd back to a
> > > > > >version just before the commit to BTX that moved it to 1.02 (March
> > > > > >18th, I think). However, that version too hangs after "BTX loader 
> > > > > >1.00
> > > > > >BTX version 1.01".
> > > > > >
> > > > > >My desktop is currently building RELENG_7_0 to see if that will work,
> > > > > >but I won't know that until later as I'm at work and it is at home :)
> > > > > >
> > > > > >The install CD (BTX 1.00/1.01) boots fine. Nothing else changed on my
> > > > > >system between the last successful boot and the unsuccessful one.
> > > > > >
> > > > > >Any suggestions/advice for what I can try next, or what I can do to
> > > > > >help the troubleshooting process?
> > > > > >
> > > > > >My desktop is an Athlon64 but I am using i386, on an Asus A8V-E 
> > > > > >Deluxe
> > > > > >board.
> > > > >
> > > > > FWIW - I am seeing this too, on a Supermicro P3TDDE. 7-STABLE src from
> > > > > 28-Feb is fine, but Mar, Apr, May code all hangs after printing 
> > > > > "loading
> > > > > /boot/defaults/loader.conf" - presumably reading my /boot/loader.conf?
> > > > >
> > > > > Interestingly I can usually get it to boot by escaping to the loader
> > > > > prompt and then just pressing return.
> > > > >
> > > > > Oddly some other machines (Supermicro P3TDER and Asus PRO31J Laptop)
> > > > > behave normally with src from Mar->May.
> > > > >
> > > > > In all cases the canonical procedure from UPDATING was used 
> > > > > (buildworld,
> > > > > kernel, reboot single, mergemaster -p, installworld, delete-old,
> > > > > mergemaster, reboot).
> > > > >
> > > > > I happy to help collect some debug info (how do you switch this on for
> > > > > the loader?), tho the machine exhibiting the problem is my workstation
> > > > > (of course)!
> > > >
> > > > Try to install new bootblock.
> > > 
> > > I would be wary of that as it might make things worse?  These problems 
> > > are all 
> > > from starting /boot/loader.  boot2 is still working fine and thus there 
> > > is 
> > > still the possiblity of using boot2 to load /boot/loader.old as a 
> > > workaround.  
> > > If you update boot2 and it breaks you can't fix that w/o booting off of 
> > > some 
> > > other media such as a CD.
> > > 
> > > Debugging these hangs is not easy to do remotely.  If you know assembly 
> > > then 
> > > there are some things you can play with.  For example, in the case where 
> > > it 
> > > hangs after printing out the BTX version (from btxldr.S) you could start 
> > > adding debugging to btx.S to print out '.' characters in various places 
> > > and 
> > > see how many get printed out before it hangs.  However, doing this 
> > > requires 
> > > familiarity with assembly and is a lot easier with physical access to a 
> > > box.
> > 
> > When I worked on my version of the realbtx, I sometimes experienced hangs 
> > when
> > vm86 btx run before real-mode btx. I did not investigated it then, only 
> > noted
> > the issue.
> > 
> 
> Try this patch.  I'm not 100% certain this will fix it as I can't reproduce
> the issue, but I think it might help.  Specifically, when the boot code makes
> a v86 call, the loader/boot2/whatever swaps in/out a new set of registers via
> the v86 structure including the eflags register.  However, none of the boot
> programs actually initialized the v86 structure.   Thus, the BIOS routines
> would start off running with whatever garbage was in v86.efl when each boot
> program started.  This meant that we could end up invoking BIOS routines with
> interrupts disabled, and I think this might explain a hard hang (if a BIOS
> routine was waiting for an interrupt the interrupt would never fire).  The
> patch fixes all the boot programs to initialize v86 to a better known state. 
> At the least it sets v86.efl to a sane value (0x202) rather than random.  (The
> random might have always been 0x0 BTW, no

Re: BTX loader hangs after version info

2008-05-24 Thread James Seward
`On Fri, May 23, 2008 at 11:11 PM, John Baldwin <[EMAIL PROTECTED]> wrote:
> [patch]

I have not yet tried this patch, but here is my progress so far:

* Rolling back to 7.0-RELEASE made it worse - now after choosing
FreeBSD from grub the machine would immediately reboot.
* I booted with the CD again and came forward to RELENG_7. This still
caused an immediate reboot.
* I booted with the CD and replaced grub with "boot0cfg -B" (bsdlabel,
which I tried earlier, had no effect). This fixed it, mostly.

My desktop now boots fine and completes normal startup. It even starts
X. However, from the moment I press F1 to choose FreeBSD to the moment
it's done booting, all I see on the screen is "BTX loader 1.00 BTX
version is 1.02" and the cursor blinking below it. My only clues that
it's booting at the time are disk activity, and the cursor changing
from a flashing underline to a solid block (which it always has as the
kernel proper takes over).

The next thing I see is "FreeBSD/i386 (hostname.goes.here) (ttyv0)". I
have also noticed that I don't get any output when I restart - no rc.d
scripts telling me things are stopping, no vnodes syncing, nothing.
It's apparently happening though, as everything is
starting/stopping/umounting correctly.

I don't see that I have anything configured to boot to serial rather
than the console, but is there anything I can do/check to make sure
this definitely isn't happening? Unfortunately, putting a cable on the
serial port is not an option as I currently do not own one suitable :)

Thanks,
James
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


ZFS on root and disk write caching.

2008-05-24 Thread Andrew Hill
I don't have a definite answer to your first two questions (I've got a
similar set up and would be interested to get some definite answers to
those) however I'd like to comment on your third point...

On May 21, 11:00 pm, [EMAIL PROTECTED] (Arnaud Houdelette) wrote:
> 3. I'd like to keep the storage pool (zraid1) separated from the system
> pool (just one disk). The wiki states that we may encounter problems
> with more than one pool in use : is it still the case ?

as for encountering problems with multiple zpools, my impression from the
mailing lists is that it seems to work fine for some people and not for
others... (i'm in the latter category, unfortunately)

but what struck me as odd is the desire to create two separate zpools - one
for data storage and one for the system. i think one of zfs's greatest
strengths is the abstraction/separation between disks and filesystems.
unless you're planning on removing/recreating the raidz1 pool in the near
future, it seems a bit odd to put your system on a single/separate,
non-redundant drive when you could just create a raidz across all four disks
with storage and system filesystems in the one raidz pool. this way you
don't lose anything if the disk you chose to run the OS from happens to
fail, or even just gets a bad sector in an unfortunately crucial location...

And even if you were going to recreate the raidz pool in the near future, it
shouldn't be too hard to backup the system filesystems with zfs
snapshot/send/receive commands, recreate the pool and then restore the
system filesystems from the backup

Andrew
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: BTX loader hangs after version info

2008-05-24 Thread Eugene Grosbein
On Sat, May 24, 2008 at 05:34:57PM +0100, James Seward wrote:

> X. However, from the moment I press F1 to choose FreeBSD to the moment
> it's done booting, all I see on the screen is "BTX loader 1.00 BTX
> version is 1.02" and the cursor blinking below it. My only clues that
> it's booting at the time are disk activity, and the cursor changing
> from a flashing underline to a solid block (which it always has as the
> kernel proper takes over).

It seems you have /boot/device.hints missing or broken.
Just do "cp /usr/src/sys/i386/conf/GENERIC.hints /boot/device.hints".

Eugene Grosbein
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: ZFS on root and disk write caching.

2008-05-24 Thread Zaphod Beeblebrox
On Sat, May 24, 2008 at 12:26 PM, Andrew Hill <[EMAIL PROTECTED]> wrote:


> but what struck me as odd is the desire to create two separate zpools - one
> for data storage and one for the system. i think one of zfs's greatest
> strengths is the abstraction/separation between disks and filesystems.


There are a few reasons to consider more than one zpool.  One is
performance.  Another is the ability to boot from it (AFAIK, you can only
boot from mirror'd pools).  The ZFS abstraction is cool --- but it's not
magic.
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: sched_ule performance on single CPU

2008-05-24 Thread Chuck Swiger

On May 23, 2008, at 6:37 PM, Unga wrote:

When open an pdf has two types of scenarios in FreeBSD:
1. When X run as a realtime-prio process, X go mad and swallow up  
almost all of CPU cycles, making audio hiccups.


2. When X run as a normal-prio process, X behaves well and rarely  
gets an audible hiccup.


Why X behave different under different priority categories?  Isn't  
this scheduler related?


Sure.  To generalize, the traditional scheduler goal for Unix has been  
to maximize overall throughput and avoid starvation of even low- 
priority tasks, at the expense of higher and unpredictable latency.   
Using realtime priority means that the kernel is told to minimize  
latency for that process even if it means starving other processes of  
CPU time.


That is well suited for things like CD/DVD burning or audio/visual  
capture, but as you've experienced yourself, it does poorly for  
heavily client-server oriented stuff like X11's architecture.


I wonder the issue I mentioned, open a pdf while playback audio, is  
it a issue on Apple Mac OSX?


Nope.  :-)

Could somebody give some light here who uses an Apple Mac OSX on  
this list?


If it is not an issue in Mac OSX, how they have overcome it then?



While both FreeBSD and MacOS X are general-purpose operating systems,  
doing multimedia creation and playback is among the primary  
functionality goals for MacOS X, in much the same way that FreeBSD  
regards providing "robust network services" like Apache, DNS, email,  
databases and so forth.


Core Audio is probably the biggest user of realtime thread scheduling  
under MacOS X, followed by QuickTime or DVD playback over Core Video.   
These frameworks were designed to handle multimedia without skipping  
by preallocating sensible amounts of buffer space, and they take  
advantage of the Mach kernel and IOKit drivers which are intended to  
support realtime needs.  Unlike the traditional BSD kernels, the Mach  
kernel was originally designed with SMP, soft & hard realtime  
scheduling in the kernel.  The original userland threads library which  
came with Mach, called CThreads, was largely responsible for the  
design that was abstracted into the portable POSIX threads model  
widely used today.


After FreeBSD 4, there has been a tremendous amount of work in the  
kernel on fine-grained locking and moving device drivers from running  
in the non-preemptable interrupt context to having device kernel  
threads which can be preempted, and there has also been a lot of work  
on the userland side to improve the C threading libraries and to  
improve multithreaded malloc() performance via jemalloc, but this is  
still ongoing and higher level applications like X11 programs haven't  
had years to adapt and take advantage of these changes.


Simple things like auto-tuning the size of the audio buffers to avoid  
or minimize skipping or dropouts isn't really in place yet with  
FreeBSD.  Realtime video on FreeBSD is dependent upon X11, which was  
originally designed by a bunch of guys at MIT to be able to display  
lots of xterms or other things involving simple blits of bits,  
possibly over the network, in order to replace the Andrew window  
manager system used by CMU, MIT, IBM, and a few others.  X11 wasn't  
designed to do alpha channel (aka transparency), much less stream a  
couple of hundred MB per second of data for realtime OpenGL texturing  
or video.  (Although, Composite and GLX have since been added to X11,  
they are extensions rather than core functionality, and hardware  
driver support for GLX is less than perfectly available, especially  
once you start looking at the AMD64/EM64T platform, rather than 32-bit  
x86)


There's a 2002 BSDcon paper here, written around the time of FreeBSD  
5.x's release, which has more details:


http://www.usenix.org/events/bsdcon02/full_papers/gerbarg/gerbarg_html/

Regards,
--
-Chuck

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"