[Vserver] Hostname confusion inside vserver

2005-12-18 Thread Roché Compaan
Any reason why /usr/bin/mail would think the hostname is the host's
hostname and not the vserver's, even though the hostname command correctly
returns the vserver's hostname?

-- 
Roché Compaan
Upfront Systems   http://www.upfrontsystems.co.za

___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] memory problems?

2005-12-13 Thread Roché Compaan
On Mon, 2005-12-12 at 18:41 +0100, Herbert Poetzl wrote:
> On Mon, Dec 12, 2005 at 07:34:01PM +0200, Roché Compaan wrote:
> > On Mon, 2005-12-12 at 18:19 +0100, Herbert Poetzl wrote:
> > > On Mon, Dec 12, 2005 at 07:13:46PM +0200, Roché Compaan wrote:
> > > > On Mon, 2005-12-12 at 16:53 +0100, Herbert Poetzl wrote:
> > > > > On Mon, Dec 12, 2005 at 03:34:13PM +0200, Roché Compaan wrote:
> > > > > > On Mon, 2005-12-12 at 03:06 +0100, Herbert Poetzl wrote:
> > > > > > > On Sun, Dec 11, 2005 at 10:28:04PM +0200, Roché Compaan wrote:
> > > > > > > > On Sun, 2005-12-11 at 11:34 -0800, Alexander Kabanov wrote:
> > > > > > > > > hi,
> > > > > > > > > 
> > > > > > > > > i'm having similar errors (I do have limits and scheduler 
> > > > > > > > > set, using
> > > > > > > > > rlimits (as, rss, nproc) and scheduler) whenever i do stress 
> > > > > > > > > testing,
> > > > > > > > > (overloading mta or web server for example).
> > > > > > > > > 
> > > > > > > > > during a stress test, some applications die because of no 
> > > > > > > > > memory
> > > > > > > > > available or can't fork, some stop with segmentation fault 
> > > > > > > > > (not able
> > > > > > > > > to do vserver  enter),. when attacking httpd might have 
> > > > > > > > > httpd
> > > > > > > > > .
> > > > > > > > 
> > > > > > > > I am experiencing the same problems. The segfaults and not 
> > > > > > > > being able to
> > > > > > > > enter a vserver from the host *really* worries me.
> > > > > > > 
> > > > > > > well, if the limits are reached, the guest can not create
> > > > > > > new processes and/or instantiate more memory ... of course
> > > > > > > this might lead to program termination and the fact that
> > > > > > > a guest cannot be entered (as the limits are hard limits).
> > > > > > > raising them will make it all work again ...
> > > > > > 
> > > > > > If the vserver is hitting the limit then I'm less worried because I
> > > > > > can solve the problem by increasing the limit. I misread and thought
> > > > > > that there was plenty of memory to spare.
> > > > > >
> > > > > > Would I be right in assuming that increasing only the virtual memory
> > > > > > will solve the problem? 
> > > > > 
> > > > > probably that will solve 80% of the issues 
> > > > > (see VM vs RSS hit ratio)
> > > > 
> > > > Where?
> > > 
> > > in the original email you sent (you removed the
> > > lines so I could not refer to them ...)
> > 
> > Ah, thanks.
> > 
> > > 
> > > > > > I don't mind if virtual servers use swap space if they need memory
> > > > > > because we have plenty of disk space, but I don't want them to
> > > > > > consume all the physical memory on the box.
> > > > > 
> > > > > trust me, you do mind as soon as the guests start
> > > > > swapping in and out ...
> > > > 
> > > > Sorry, you'll have to explain - I don't understand how the vserver or
> > > > the linux kernel manages virtual memory or what you mean when you say
> > > > "swapping in and out".
> > > 
> > > consider a total of 256 MB memory (RAM) on the host
> > > further, consider three guests with a memory footprint
> > > of 128MB RSS (means they need to have 128MB in memory
> > > to run, that's what Resident Set Size is), now they
> > > are alternating and will constantly swap in and out
> > > memory, because 3*128 > 256 ...
> > 
> > But what if I limit the sum of virtual server RSS limits to never
> > exceed the total RAM on the host as a rule, and make sure that there
> > is enough virtual memory for all of them? Ie. I have 4 GB RAM on
> > the host and 4 vservers that each have a hard limit of 1 GB RSS and
> > say triple the virtual memory. Would I still get memory errors when
> > vservers reach the RSS limit, or only when they reach the VM limit?
> 
> assumed that the guests use the RSS equally, you
> will not get any over RSS limit hits, as the pages
> will be swapped out when (or slightly before) they
> reach the limit (but in reality, one or the other
> guest will try to use slightlly more and will hit
> the hard limit ...)

It seems like the most responsible thing to do now is to abandon hard
limits (and wait for soft limits) and babysit vservers in the mean time.
Processes that take up to match memory can then either be restarted or
killed manually, rather than allowing the kernel to make that decision.

-- 
Roché Compaan
Upfront Systems   http://www.upfrontsystems.co.za

___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] memory problems?

2005-12-12 Thread Roché Compaan
On Mon, 2005-12-12 at 18:19 +0100, Herbert Poetzl wrote:
> On Mon, Dec 12, 2005 at 07:13:46PM +0200, Roché Compaan wrote:
> > On Mon, 2005-12-12 at 16:53 +0100, Herbert Poetzl wrote:
> > > On Mon, Dec 12, 2005 at 03:34:13PM +0200, Roché Compaan wrote:
> > > > On Mon, 2005-12-12 at 03:06 +0100, Herbert Poetzl wrote:
> > > > > On Sun, Dec 11, 2005 at 10:28:04PM +0200, Roché Compaan wrote:
> > > > > > On Sun, 2005-12-11 at 11:34 -0800, Alexander Kabanov wrote:
> > > > > > > hi,
> > > > > > > 
> > > > > > > i'm having similar errors (I do have limits and scheduler set, 
> > > > > > > using
> > > > > > > rlimits (as, rss, nproc) and scheduler) whenever i do stress 
> > > > > > > testing,
> > > > > > > (overloading mta or web server for example).
> > > > > > > 
> > > > > > > during a stress test, some applications die because of no memory
> > > > > > > available or can't fork, some stop with segmentation fault (not 
> > > > > > > able
> > > > > > > to do vserver  enter),. when attacking httpd might have httpd
> > > > > > > .
> > > > > > 
> > > > > > I am experiencing the same problems. The segfaults and not being 
> > > > > > able to
> > > > > > enter a vserver from the host *really* worries me.
> > > > > 
> > > > > well, if the limits are reached, the guest can not create
> > > > > new processes and/or instantiate more memory ... of course
> > > > > this might lead to program termination and the fact that
> > > > > a guest cannot be entered (as the limits are hard limits).
> > > > > raising them will make it all work again ...
> > > > 
> > > > If the vserver is hitting the limit then I'm less worried because I
> > > > can solve the problem by increasing the limit. I misread and thought
> > > > that there was plenty of memory to spare.
> > > >
> > > > Would I be right in assuming that increasing only the virtual memory
> > > > will solve the problem? 
> > > 
> > > probably that will solve 80% of the issues 
> > > (see VM vs RSS hit ratio)
> > 
> > Where?
> 
> in the original email you sent (you removed the
> lines so I could not refer to them ...)

Ah, thanks.

> 
> > > > I don't mind if virtual servers use swap space if they need memory
> > > > because we have plenty of disk space, but I don't want them to
> > > > consume all the physical memory on the box.
> > > 
> > > trust me, you do mind as soon as the guests start
> > > swapping in and out ...
> > 
> > Sorry, you'll have to explain - I don't understand how the vserver or
> > the linux kernel manages virtual memory or what you mean when you say
> > "swapping in and out".
> 
> consider a total of 256 MB memory (RAM) on the host
> further, consider three guests with a memory footprint
> of 128MB RSS (means they need to have 128MB in memory
> to run, that's what Resident Set Size is), now they
> are alternating and will constantly swap in and out
> memory, because 3*128 > 256 ...

But what if I limit the sum of virtual server RSS limits to never exceed
the total RAM on the host as a rule, and make sure that there is enough
virtual memory for all of them? Ie. I have 4 GB RAM on the host and 4
vservers that each have a hard limit of 1 GB RSS and say triple the
virtual memory. Would I still get memory errors when vservers reach the
RSS limit, or only when they reach the VM limit?

-- 
Roché Compaan
Upfront Systems   http://www.upfrontsystems.co.za

___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] memory problems?

2005-12-12 Thread Roché Compaan
On Mon, 2005-12-12 at 16:53 +0100, Herbert Poetzl wrote:
> On Mon, Dec 12, 2005 at 03:34:13PM +0200, Roché Compaan wrote:
> > On Mon, 2005-12-12 at 03:06 +0100, Herbert Poetzl wrote:
> > > On Sun, Dec 11, 2005 at 10:28:04PM +0200, Roché Compaan wrote:
> > > > On Sun, 2005-12-11 at 11:34 -0800, Alexander Kabanov wrote:
> > > > > hi,
> > > > > 
> > > > > i'm having similar errors (I do have limits and scheduler set, using
> > > > > rlimits (as, rss, nproc) and scheduler) whenever i do stress testing,
> > > > > (overloading mta or web server for example).
> > > > > 
> > > > > during a stress test, some applications die because of no memory
> > > > > available or can't fork, some stop with segmentation fault (not able
> > > > > to do vserver  enter),. when attacking httpd might have httpd
> > > > > .
> > > > 
> > > > I am experiencing the same problems. The segfaults and not being able to
> > > > enter a vserver from the host *really* worries me.
> > > 
> > > well, if the limits are reached, the guest can not create
> > > new processes and/or instantiate more memory ... of course
> > > this might lead to program termination and the fact that
> > > a guest cannot be entered (as the limits are hard limits).
> > > raising them will make it all work again ...
> > 
> > If the vserver is hitting the limit then I'm less worried because I
> > can solve the problem by increasing the limit. I misread and thought
> > that there was plenty of memory to spare.
> >
> > Would I be right in assuming that increasing only the virtual memory
> > will solve the problem? 
> 
> probably that will solve 80% of the issues 
> (see VM vs RSS hit ratio)

Where?

> > I don't mind if virtual servers use swap space if they need memory
> > because we have plenty of disk space, but I don't want them to consume
> > all the physical memory on the box. 
> 
> trust me, you do mind as soon as the guests start
> swapping in and out ...

Sorry, you'll have to explain - I don't understand how the vserver or
the linux kernel manages virtual memory or what you mean when you say
"swapping in and out".

> 
> > Does setting a hard limit for RSS achieve this?
> 
> not yet ...

How will it do this in future?

-- 
Roché Compaan
Upfront Systems   http://www.upfrontsystems.co.za

___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] memory problems?

2005-12-12 Thread Roché Compaan
On Mon, 2005-12-12 at 03:06 +0100, Herbert Poetzl wrote:
> On Sun, Dec 11, 2005 at 10:28:04PM +0200, Roché Compaan wrote:
> > On Sun, 2005-12-11 at 11:34 -0800, Alexander Kabanov wrote:
> > > hi,
> > > 
> > > i'm having similar errors (I do have limits and scheduler set, using
> > > rlimits (as, rss, nproc) and scheduler) whenever i do stress testing,
> > > (overloading mta or web server for example).
> > > 
> > > during a stress test, some applications die because of no memory
> > > available or can't fork, some stop with segmentation fault (not able
> > > to do vserver  enter),. when attacking httpd might have httpd
> > > .
> > 
> > I am experiencing the same problems. The segfaults and not being able to
> > enter a vserver from the host *really* worries me.
> 
> well, if the limits are reached, the guest can not create
> new processes and/or instantiate more memory ... of course
> this might lead to program termination and the fact that
> a guest cannot be entered (as the limits are hard limits).
> raising them will make it all work again ...

If the vserver is hitting the limit then I'm less worried because I can
solve the problem by increasing the limit. I misread and thought that
there was plenty of memory to spare.

Would I be right in assuming that increasing only the virtual memory
will solve the problem? I don't mind if virtual servers use swap space
if they need memory because we have plenty of disk space, but I don't
want them to consume all the physical memory on the box. Does setting a
hard limit for RSS achieve this?

-- 
Roché Compaan
Upfront Systems http://www.upfrontsystems.co.za

___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] memory problems?

2005-12-11 Thread Roché Compaan
On Sun, 2005-12-11 at 11:34 -0800, Alexander Kabanov wrote:
> hi,
> 
> i'm having similar errors (I do have limits and scheduler set, using
> rlimits (as, rss, nproc) and scheduler) whenever i do stress testing,
> (overloading mta or web server for example).
> 
> during a stress test, some applications die because of no memory
> available or can't fork, some stop with segmentation fault (not able
> to do vserver  enter),. when attacking httpd might have httpd
> .

I am experiencing the same problems. The segfaults and not being able to
enter a vserver from the host *really* worries me.

-- 
Roché Compaan
Upfront Systems   http://www.upfrontsystems.co.za

___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] memory problems?

2005-12-11 Thread Roché Compaan
On Sun, 2005-12-11 at 19:26 +0100, Herbert Poetzl wrote:
> On Sun, Dec 11, 2005 at 08:19:11PM +0200, Roché Compaan wrote:
> > The following is logged quite often to the syslog in a vserver and I'm
> > worried since I don't see this in any of our regular servers:
> > 
> > postfix/sendmail[32274]: warning: fork: Cannot allocate memory
> 
> interesting, what does your /proc/virtual//limits 
> file (with the xid of that guest) show?

[EMAIL PROTECTED]:~# cat /proc/virtual/49196/limit
PROC:  120 266  -1   0
VM: 407806  50  50 505
VML: 0   0  -1   0
RSS:194897  25  25  97
ANON:   181688  182048  -1   0
FILES: 9361970  -1   0
OFD:   331 678  -1   0
LOCKS:  10  25  -1   0
SOCK:  128 355  -1   0
MSGQ:0   0  -1   0
SHM: 0   0  -1   0


> 
> > This is on Debian sarge on a 2.6 kernel with vserver v 2.0. The postfix
> > server in question is not busy at all and the vserver has plenty of
> > memory to spare.
> > 
> > Any reason to worry here?
> 
> well, I would try with a recent patch and see if it
> is still an issues ...

The latest patch in Debian (unstable) seems to be
patch-2.6.14.3-vs2.0.1-rc5.diff. Is this recent enough?

-- 
Roché Compaan
Upfront Systems   http://www.upfrontsystems.co.za

___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


[Vserver] memory problems?

2005-12-11 Thread Roché Compaan
The following is logged quite often to the syslog in a vserver and I'm
worried since I don't see this in any of our regular servers:

postfix/sendmail[32274]: warning: fork: Cannot allocate memory

This is on Debian sarge on a 2.6 kernel with vserver v 2.0. The postfix
server in question is not busy at all and the vserver has plenty of
memory to spare.

Any reason to worry here?

-- 
Roché Compaan
Upfront Systems   http://www.upfrontsystems.co.za

___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


[Vserver] Problem with shutdown

2005-12-06 Thread Roché Compaan
Squid takes longer than most processes to stop, and this seems be a
problem when stopping a vserver:

Stopping periodic command scheduler: cron.
Stopping ClamAV daemon: clamd
Stopping ClamAV virus database updater: freshclam
Stopping mail transport agent: Postfix.
Stopping OpenBSD Secure Shell server: sshd.
Stopping supervisor daemon: supervisord
Stopping amavisd: amavisd-new.
Stopping SpamAssassin Mail Filter Daemon: spamd.
Stopping proxy server: (waiting.../usr/sbin/vserver: line
85: 20939 Killed  "[EMAIL PROTECTED]" ${USE_VNAMESPACE:
+$_VNAMESPACE --enter "$S_CONTEXT" -- } $_VCONTEXT $SILENT_OPT --migrate
--chroot --xid "$S_CONTEXT" -- "[EMAIL PROTECTED]"

Is the stop script experiencing a timeout and if so, is there a setting
one can change to let it wait until squid has stopped completely?

-- 
Roché Compaan
Upfront Systems http://www.upfrontsystems.co.za

___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] /dev/null: Permission denied

2005-12-06 Thread Roché Compaan
On Tue, 2005-12-06 at 15:18 -0500, Cedric Veilleux wrote:
> Hi,
> 
> > Whenever I start the vserver, init scripts accessing /dev/null (or any
> > subsequent commands) returns "Permission denied". Re-creating /dev/null
> > outside the vserver does not help. "ls -l" shows this is a proper device
> > file:
> 
> Ensure the partition were your vserver is located is not mounted with
> the NODEV option.
> 
> The "mount" command in the host should show it if that is the problem. I
> think a default debian install has all but the root partition mounted
> with NODEV.. 

That's it. Thanks! I am using Debian, but I can't confirm that it is a
Debian default. I mounted my '/var/' partition with nodev as a security
measure because it was always my intention to create vservers on DRBD
devices.

-- 
Roché Compaan
Upfront Systems   http://www.upfrontsystems.co.za

___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] /dev/null: Permission denied

2005-12-06 Thread Roché Compaan
On Tue, 2005-12-06 at 22:03 +0200, Roché Compaan wrote:
> On Tue, 2005-12-06 at 20:53 +0100, Herbert Poetzl wrote:
> > On Tue, Dec 06, 2005 at 09:42:54PM +0200, Roché Compaan wrote:
> > > Hi there
> > > 
> > > I created a virtual server by first creating a skeleton and then
> > > copying the files from an existing vserver to the new one.
> > >
> > > Whenever I start the vserver, init scripts accessing /dev/null (or
> > > any subsequent commands) returns "Permission denied". Re-creating
> > > /dev/null outside the vserver does not help. "ls -l" shows this is a
> > > proper device file:
> > > 
> > > crw-rw-rw-  1 root root 1, 3 2005-12-02 21:32 null
> > > 
> > > Any idea how to fix this?
> > 
> > well, looking deep into my crystal ball tells
> > me that there is something wrong with the path
> > leading to /dev/null, so check the following:
> > 
> >  ls -lad /. /dev
> 
> Inside the virtual server, "ls -lad /. /dev" returns:
> 
> drwxr-xr-x  20 root root 4096 2005-12-06 14:33 /.
> drwxr-xr-x   3 root root 4096 2005-12-06 22:01 /dev
> 
> Anything wrong here?

Ok, I just tried to create another vserver in the same method as
described above with the only difference being that I created it on a
DRBD block device, and it worked. My skeleton also resides on a DRBD
block device, so it seems that I cannot create a new vserver on another
block device or partition that is not a DRBD block device? I would have
guessed that it shouldn't make a difference.

-- 
Roché Compaan
Upfront Systems   http://www.upfrontsystems.co.za

___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] /dev/null: Permission denied

2005-12-06 Thread Roché Compaan
On Tue, 2005-12-06 at 20:53 +0100, Herbert Poetzl wrote:
> On Tue, Dec 06, 2005 at 09:42:54PM +0200, Roché Compaan wrote:
> > Hi there
> > 
> > I created a virtual server by first creating a skeleton and then
> > copying the files from an existing vserver to the new one.
> >
> > Whenever I start the vserver, init scripts accessing /dev/null (or
> > any subsequent commands) returns "Permission denied". Re-creating
> > /dev/null outside the vserver does not help. "ls -l" shows this is a
> > proper device file:
> > 
> > crw-rw-rw-  1 root root 1, 3 2005-12-02 21:32 null
> > 
> > Any idea how to fix this?
> 
> well, looking deep into my crystal ball tells
> me that there is something wrong with the path
> leading to /dev/null, so check the following:
> 
>  ls -lad /. /dev

Inside the virtual server, "ls -lad /. /dev" returns:

drwxr-xr-x  20 root root 4096 2005-12-06 14:33 /.
drwxr-xr-x   3 root root 4096 2005-12-06 22:01 /dev

Anything wrong here?

-- 
Roché Compaan
Upfront Systems   http://www.upfrontsystems.co.za

___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


[Vserver] /dev/null: Permission denied

2005-12-06 Thread Roché Compaan
Hi there

I created a virtual server by first creating a skeleton and then copying
the files from an existing vserver to the new one.

Whenever I start the vserver, init scripts accessing /dev/null (or any
subsequent commands) returns "Permission denied". Re-creating /dev/null
outside the vserver does not help. "ls -l" shows this is a proper device
file:

crw-rw-rw-  1 root root 1, 3 2005-12-02 21:32 null

Any idea how to fix this?

-- 
Roché Compaan
Upfront Systems   http://www.upfrontsystems.co.za

___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver