[9fans] disturbing disk access

2010-10-02 Thread Rudolf Sykora
Hello,

even when I 'do nothing' there is a disk access every cca 15 seconds
on my plan9 notebook.
Can anyone tell me why this happens? Can I find what causes it?

It's quite disturbing and perhaps unnecessary...

Thanks!
Ruda



Re: [9fans] disturbing disk access

2010-10-02 Thread erik quanstrom
 even when I 'do nothing' there is a disk access every cca 15 seconds
 on my plan9 notebook.
 Can anyone tell me why this happens? Can I find what causes it?

you can start with
grep '(#S|/dev/sd..)/' /proc/*/fd

but obviously, that's just going to give you fossil or venti.

you can try looking for programs that might be sleeping for 15
seconds at a time,

minooka;  g 'sleep\(15[^)][^)]' . | awk -F: '{if($1 != o)print; o = $1}'
./faces/plumb.c:119:sleep(15000);
./upas/fs/fs.c:1603:sleep(15*1000);
./upas/pop3/pop3.c:710: sleep(15*1000);
./upas/imap4d/imap4d.c:858: sleep(15*1000);

if one of these is the culprit, it may be that your fs is writing
atimes to disk every 15 seconds.

 It's quite disturbing and perhaps unnecessary...

if the wild guess above is correct, you can either
- not run these programs, or
- use kfs with atime turned off rather than your current
fs setup.

- erik



Re: [9fans] disturbing disk access

2010-10-02 Thread Rudolf Sykora
 you can start with
        grep '(#S|/dev/sd..)/' /proc/*/fd


this gives me /dev/sdC0/^(fossil arenas isect) all many times

 minooka;  g 'sleep\(15[^)][^)]' . | awk -F: '{if($1 != o)print; o = $1}'

where do you run this so that you obtain the following? My 'g', as far
as I know, doesn't walk through directories... (???)

 ./faces/plumb.c:119:                    sleep(15000);
 ./upas/fs/fs.c:1603:    sleep(15*1000);
 ./upas/pop3/pop3.c:710:                 sleep(15*1000);
 ./upas/imap4d/imap4d.c:858:                             sleep(15*1000);

 if the wild guess above is correct, you can either
 - not run these programs, or
 - use kfs with atime turned off rather than your current
 fs setup.

Thanks
Ruda



Re: [9fans] disturbing disk access

2010-10-02 Thread erik quanstrom
 this gives me /dev/sdC0/^(fossil arenas isect) all many times

so it could be atime access.  try halting all the programs
previously listed and seeing if that doesn't stop disk
activity.

 where do you run this so that you obtain the following? My 'g', as far
 as I know, doesn't walk through directories... (???)

contrib quanstro/g.  the idea was shamelessly stolen from russ,
with the additional twist that directories passed as arguments
are recursively searched.  thus g pattern in /sys/src/cmd searches
only single-file commands; while g pattern . searches all commands.

- erik



Re: [9fans] disturbing disk access

2010-10-02 Thread erik quanstrom
 I don't know exactly what I killed, but killing what showed as 'fs' by
 'ps' helped.
 No more disc operation every 15 seconds any more...
 Thanks!

that's upas/fs.

- erik



[9fans] 9vx tutorial: running a cpu server from kfs (RFC)

2010-10-02 Thread yy
This tutorial is a work in progress (it will eventually be added to
the 9vx documentation and probably to the Plan 9 wiki). Please let me
know if you see anything I'm doing wrong (unfortunately I don't have
too much experience with real Plan 9 systems of more than one
machine). In particular, I don't know why I could not use mkfs instead
of dircp. The line

% disk/mkfs -s /n/9660 /sys/lib/sysconfig/proto/allproto

gave me this error:

mkfs: /sys/lib/sysconfig/proto/allproto:1: can't move tmp file to
/n/kfs/dist/replica/plan9.compressed.db: wstat -- unknown type/mode

Anyway, these instructions are working here. Please, let me know if
they work for you too.

By the way, this tutorial is only the first one, but I'd like to have
some more. For example, to run several 9vx instances in a private
network using the tap device and to run 9vx from fossil backed up by
p9p's venti. Contributions are welcomed ;-)


--


This is a brief tutorial on how to run a 9vx cpu server from a kfs
file system. You will need 9vx, a plan9.iso and some free disk space.

First, go to the destination directory and install 9vx:

$ hg clone http://bitbucket.org/yiyus/vx32/
$ cd vx32/src/
$ make 9vx/9vx  sudo make 9vx/install

(Commands run on the host are preceded by $, commands run from inside
9vx are preceded with %)

You can check that 9vx is working running the minimal system embedded
in the executable. The rcvx script should take you to a vx32% rc
prompt in the current directory. Once you have played a bit with a
rootless 9vx type exit to go back to your host system.

Rcvx is cool but you will want a full Plan 9 tree to have real fun.
Let's boot from the iso file:

$ 9vx -r plan9.iso -u glenda CWD=#Z`pwd` nvram=#Z`pwd`/plan9.nvr

You should be in rio now, have an acme and a rio window, stats,
faces... This is the live system in the iso that you probably already
know. The CWD=... and nvram=... arguments are interpreted as plan9.ini
lines and passed as environment variables, we will use them later.

Open a new rio window:

% cd $CWD
% dd -if /dev/random -of plan9.nvr -bs 512 -count 1
% dd -if /dev/zero -of plan9.kfs -bs 1024 -count 32

Those files will be our nvram and kfs partitions (check the size of
your kfs file, 320Mb is not too much, but will be enough). Nvram needs
to be initialized:

% auth/wrkey
authid: bootes
authdom: 9vx
secstore key:
password:

We can populate the file system now:

% 9660srv -f plan9.iso
% 9fs 9660
% disk/kfs -f plan9.kfs
File system main inconsistent
Would you like to ream it (y/n)? y
% 9fs kfs
% dircp /n/9660 /n/kfs

The system is now installed. You should be able to open a new 9vx
instance from your new root:

$ 9vx nvram=#Z`pwd`/plan9.nvr' -r plan9.kfs -u glenda

You can also boot a cpu server. We will use the canopenpath option, so
that only the files which begin with `pwd`/plan9 can be opened from
9vx, the -ic flags tell 9vx to pass -c to /386/init:

   $ 9vx -gic -r plan9.kfs nvram=#Z`pwd`/plan9.nvr
canopenpath=`pwd`/plan9 -u bootes

When you see the vx32# prompt add a key so that you can cpu as glenda:

vx32# echo 'key proto=p9sk1 dom=9vx user=glenda
!password=password' /mnt/factotum/ctl

Now you can cpu to your new server. From another 9vx instance (for
example, booted from the iso):

% cpu -h 127.0.0.1

If it worked we are done.

Now you will probably want to adjust to your needs the 9vxc script to
launch cpu servers (also, think about adding a /cfg/vx32/cpurc file).
You could be interested in the options localroot, canopenpath,
cpulimit and memsize. Or maybe you want to setup a virtual ethernet
device (have a look at the tap script and the 9vx man page).

Have fun! (and please, report bugs)


-- 
- yiyus || JGL . 4l77.com