On Wed, Jan 19, 2011 at 6:15 PM, Alvaro Lopez Ortega <[email protected]>wrote:

> On 19/01/2011, at 22:11, Alvaro Lopez Ortega wrote:
> > On 19/01/2011, at 21:51, Diego Schulz wrote:
> >
> > I'm sorry, but I cannot agree this this.  I do not think the rest of the
> Cherokee users should lose any feature because of a functionality regression
> in FreeBSD 8.  Instead, if no alternative way of figuring the number of CPUs
> was found, I'd rather disable the CPU meter on FreeBSD.  At the end of the
> day, the functionality is found on all OSes but on a concrete version of
> FreeBSD.
> >
> > However, IMHO that would be a nasty workaround for running Cherokee on
> FreeBSD 8. If you asked me, I'd say that the problem is actually on FreeBSD
> 8, not Cherokee.  Cherokee might have been the first project to hit the
> issue, but it will certainly not the last one to require this lost
> functionality.
> >
> > Do you know whether it was removed on purpose? It might be a just bug,
> actually.
>

Unfortunately the implementation as it is currently, is plain wrong (and
it's completely my fault.)
It's wrong in 7.x too.

In 7.x we've got this node (kern.threads.virtual_cpu) and we can get the
number of *virtual* cpus,
which happens to be the same value of hw.ncpu node and by coincidence
the same of kern.smp.cpus too, if SMP support is compiled in (almost every
kernel is).

So we've got 3 systcl nodes (that I know of) with essentially the same
value, in 7.x and 8.x.
The three can be interpreted as the "number of CPUs", but there's no strict
distinction on physical/virtual.
I actually expect hw.ncpu to be the physical count, but clearly it's not.
I couldn't find enough documentation on this, other than the sources :-)

$ sysctl -a hw.ncpu  kern.smp.cpus  kern.threads.virtual_cpu
hw.ncpu: 2
kern.smp.cpus: 2
kern.threads.virtual_cpu: 2    <--- not available in 8.x

Considering what you said on sacrificing functionality that is available in
other OSes, I think we can just display:

 hw.ncpu as Physical CPU count (lying a little)
 kern.smp.cpus as Number of CPU Cores

Appart from that, there's a controversy on how the memory usage should
be interpreted on FreeBSD. Currently the reading shows exactly the same
data as the top program, but there's valuable data missing: the 'active'
memory usage, which is as important as the (total physical - free) memory,
and always a much lower value.

Here's how it looks:

CPU:     % user,     % nice,     % system,     % interrupt,     % idle
Mem: 577M Active, 1538M Inact, 196M Wired, 160K Cache, 112M Buf, 686M Free
Swap: 1991M Total, 1991M Free

The gauge in the cherokee-admin interface is currently shows the "free
memory"
portion. I think It will be cool if we can somehow get the
'active' portion too,
this value seems to be much appreciated. This needs some tinkering, vmstat
doesn't
provide this info.


>
> BTW, I forgot to thank you for investigating the issue. You are doing an
> amazing job working out the issue of the FreeBSD package.  Thank you very
> much that!!!


 You're welcome, Álvaro. Thanks to you too.

cheers,

diego
_______________________________________________
Cherokee mailing list
[email protected]
http://lists.octality.com/listinfo/cherokee

Reply via email to