9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Different representations of the same file/resource in a synthetic FS
@ 2009-06-09 17:14 Roman V Shaposhnik
  2009-06-09 17:27 ` andrey mirtchovski
  2009-06-09 17:30 ` [9fans] Different representations of the same file/resource in a synthetic FS J.R. Mauro
  0 siblings, 2 replies; 19+ messages in thread
From: Roman V Shaposhnik @ 2009-06-09 17:14 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Working on a RESTful API lately (which is as close to working on a 9P
filesystem as I can get these days) I've been puzzling over this issue:
is content negotiation a good thing or a bad thing? Or to justify
posting to this list: what would be the proper 9P way of not only
representing different "renditions" of the same information in
a synthetic filesystem but also give consumer a chance to declare
*a set* of preferred ones.

Lets assume a classical example (modified slightly to fit 9P):
a synthetic filesystem that serves images from a web cam.
The very same frame can be asked for in different formats
(.gif, .png, .pdf, etc.). Is serving
   /<date>/<time>/<camera-id>/gif/frame
   /<date>/<time>/<camera-id>/png/frame
   ...
   /<date>/<time>/<camera-id>/pdf/frame
and relying on reading
   /<date>/<time>/<camera-id>
for the list of "supported" representations really better
than what HTTP content negotiation offers?

Thanks,
Roman.




^ permalink raw reply	[flat|nested] 19+ messages in thread
* Re: [9fans] Different representations of the same file/resource in a synthetic FS
@ 2009-06-09 18:15 Francisco J Ballesteros
  0 siblings, 0 replies; 19+ messages in thread
From: Francisco J Ballesteros @ 2009-06-09 18:15 UTC (permalink / raw)
  To: 9fans; +Cc: 9fans

With mail2fs I leave messages alone and use all kinds of mail lists  
that contain just relative paths to actual messages. Perhaps nupas  
could do the same.

El 09/06/2009, a las 20:11, quanstro@quanstro.net escribió:

> On Tue Jun 9 13:28:55 EDT 2009, mirtchovski@gmail.com wrote:
>> I think I've mentioned this before, but on a few of my synthetic file
>> systems here I'm using what you describe to slice a database by
>> specific orderings. For example, I have a (long) list of resources
>> which I'm managing in a particular environment each has an owner,
>> type, status and a few static data containers. It's all backed by a
>> relational database, but the file server presents different "slices"
>> of that to external users, where the directory structure is rigidly
>> defined [...]
>
> this is definately a problem for upas/fs. it would be nice, for  
> example,
> for upas/fs to have the option of sorting mailboxes in various ways.
> imap4d's requirements are not the same as nedmail's. by thread,
> by date, by order of arrival are all useful sortings. and of course,
> given the ability to manage giant piles of messages reasonably  
> efficiently,
> it's tempting to replace the idea of different boxes with different
> views of the same giant pile of messages.
>
> how are the resultant files looked up? it turns out that generating
> the file hash table was the single most expensive operation for
> upas/fs, given mailboxes with ~10k messages.
> (http://9fans.net/archive/2009/05/106)
>
> - erik
>
> [/mail/box/nemo/msgs/200906/41850]



^ permalink raw reply	[flat|nested] 19+ messages in thread
* Re: [9fans] Different representations of the same file/resource in a synthetic FS
@ 2009-06-09 18:59 erik quanstrom
  0 siblings, 0 replies; 19+ messages in thread
From: erik quanstrom @ 2009-06-09 18:59 UTC (permalink / raw)
  To: nemo, 9fans

On Tue Jun  9 14:15:29 EDT 2009, nemo@lsub.org wrote:
> With mail2fs I leave messages alone and use all kinds of mail lists
> that contain just relative paths to actual messages. Perhaps nupas
> could do the same.
>

i think that essential strategy is a winner.  upas would use
.idx files.

so the general plan would be to never delete messages.
they're in the dump anyway.  just delete them from
the index.

so that seems simple, why isn't that done already?

first, i should point out that there are some complicating
assumptions i have.  our heavy users are receiving
about 1000 messages a day after spam filtering.  it would
be pretty easy to accumulate a million messages.  also,
it's important for imap support to be able to scan several
hundred mailboxes in short order.

hopefully that's enough context to understand the two
basic problems i see:
1.  the mdir format is limited by the underlying fs
in the number of messages that can be efficiently
stored.  (my previous tests with ken's fs on a pIII
machine showed that 100k was a lower upper bound.)
a million-message index would be ~600mb on-disk.

2.  upas/fs needs memory proportinal to the number
of messages in the mailbox.  and clients need to read
directories that are sized in proportion to the number
of messages.

#1 seems straightforward to fix.  #2 seems more
fundamental.

- erik



^ permalink raw reply	[flat|nested] 19+ messages in thread
* Re: [9fans] Different representations of the same file/resource in a synthetic FS
@ 2009-06-09 19:16 erik quanstrom
  0 siblings, 0 replies; 19+ messages in thread
From: erik quanstrom @ 2009-06-09 19:16 UTC (permalink / raw)
  To: mirtchovski, 9fans

> still a hash. i'm not doing anything particularly clever for speed,
> and it shows in places. listing large directories is the slowest
> operation by far, as it would be for most cases where several thousand
> "stat" structures would have to be dynamically created for each entry
> in a directory. i'm not pre-generating anything however, so in daily
> use, where each client knows exactly where to go, i'm not seeing
> slowdowns.

thanks!

> not that i'm worried: we recently discovered a few misconfigured
> clusters around here (names withheld) that were using ldap and no
> local nameservice caching. each stat on those boxes would take 0.05 ms
> (instead of 0.005) to complete because it needed to contact a server
> for username lookup. the wait became unbearable above a number of
> thousands of files in a particular directory, so people finally
> started complaining after waiting for minutes for 'ls -l' to finish.
> things could be way worse, i guess :)

i suppose we could all be forced to reimplement vi for the
apollo landing computer.

- erik



^ permalink raw reply	[flat|nested] 19+ messages in thread
[parent not found: <eed9f9e37182c89c3e8a9982844f9d0f@quanstro.net>]
* Re: [9fans] Different representations of the same file/resource in a synthetic FS
@ 2009-06-09 19:41 erik quanstrom
  0 siblings, 0 replies; 19+ messages in thread
From: erik quanstrom @ 2009-06-09 19:41 UTC (permalink / raw)
  To: mirtchovski, 9fans

> On Tue, Jun 9, 2009 at 1:16 PM, erik quanstrom<quanstro@quanstro.net> wrote:
> >> still a hash. i'm not doing anything particularly clever for speed,
> >> and it shows in places.
>
> I lied a bit here: in some cases, for example where a particular query
> would involve going through several (up to a couple of thousand) files
> and subdirectories to compose, i provide a single file that gives me
> that information much faster and in only a fraction of the 9p queries
> it would normally would. it's by no means a general solution to the
> speed problem, but it does get me the data 30-50 times faster...
>
> but i digress...

interstingly, i considered mentioning the old upas/fs trick of the info
file, which i believe is approximately the same hack.  the "xxx" hack
i recently added to the file has table of upas/fs is somewhat the
mirror image of the info file.

i suppose that in the language of standardized assessment tests
technique is to hack as 30x is to 5%.

- erik



^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2009-06-18  0:20 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-09 17:14 [9fans] Different representations of the same file/resource in a synthetic FS Roman V Shaposhnik
2009-06-09 17:27 ` andrey mirtchovski
2009-06-09 18:10   ` erik quanstrom
2009-06-09 19:01     ` andrey mirtchovski
2009-06-11  3:44   ` Roman V. Shaposhnik
2009-06-11  4:49     ` [9fans] Different representations of the same lucio
2009-06-13  1:02       ` Roman V Shaposhnik
2009-06-13  1:56         ` erik quanstrom
2009-06-16 23:12           ` Roman V Shaposhnik
2009-06-17  8:54             ` Charles Forsyth
2009-06-18  0:20               ` Roman V Shaposhnik
2009-06-13  3:43         ` lucio
2009-06-16 23:15           ` Roman V Shaposhnik
2009-06-09 17:30 ` [9fans] Different representations of the same file/resource in a synthetic FS J.R. Mauro
2009-06-09 18:15 Francisco J Ballesteros
2009-06-09 18:59 erik quanstrom
2009-06-09 19:16 erik quanstrom
     [not found] <eed9f9e37182c89c3e8a9982844f9d0f@quanstro.net>
2009-06-09 19:31 ` andrey mirtchovski
2009-06-09 19:41 erik quanstrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).