Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Happstack website design and brand identity -- an offer to help out
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 26 - 47 of 47 - Collapse all  -  Translate all to Translated (View all originals) < Older 
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Gregory Collins  
View profile  
 More options May 25 2010, 11:19 pm
From: Gregory Collins <g...@gregorycollins.net>
Date: Tue, 25 May 2010 23:19:19 -0400
Local: Tues, May 25 2010 11:19 pm
Subject: Re: Happstack website design and brand identity -- an offer to help out

Jeremy Shaw <jer...@n-heptane.com> writes:
> The biggest 'issue' with a port to the snap backend right now is that
> the part happstack wants to use is all mixed up with the rest of the
> code. For example, Snap.Types has the Request and Response types,
> which happstack would use, but also the Snap monad. And snap-core
> contains the types we want, but also things like file serving
> utilities. We can, of course, ignore the things we don't want.. but
> when those things also add even more cabal dependencies, that is
> annoying. Happstack already has too many dependencies.

I was thinking instead of a package "snapstack", which exports a
function:

    snapstack :: ServerPartT IO Response -> Snap ()

and also an

    httpServe :: ... -> ServerPartT IO Response -> ... -> IO ()

Basically: convert the request/response types and run the happstack
monad. The conversion would be a little bit of fixed overhead.

G
--
Gregory Collins <g...@gregorycollins.net>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gregory Collins  
View profile  
 More options May 25 2010, 11:20 pm
From: Gregory Collins <g...@gregorycollins.net>
Date: Tue, 25 May 2010 23:20:06 -0400
Local: Tues, May 25 2010 11:20 pm
Subject: Re: Happstack website design and brand identity -- an offer to help out

Jeremy Shaw <jer...@n-heptane.com> writes:
> We use keep-alive provided when these conditions hold:

>  continueHTTP rq res = (isHTTP1_0 rq && checkHeaderBS connectionC keepaliveC rq) ||
>                       (isHTTP1_1 rq && not (checkHeaderBS connectionC closeC rq)) && rsfContentLength (rsFlags res)

> Which is basically:

>   HTTP 1.0, but they requested keep-alive

>   HTTP 1.1, they *didn't* request a close, and the content we are
>   sending includes a content-length.

Why don't you do chunked transfer encoding on http/1.1?

G
--
Gregory Collins <g...@gregorycollins.net>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeremy Shaw  
View profile  
 More options May 25 2010, 11:56 pm
From: Jeremy Shaw <jer...@n-heptane.com>
Date: Tue, 25 May 2010 22:56:32 -0500
Local: Tues, May 25 2010 11:56 pm
Subject: Re: Happstack website design and brand identity -- an offer to help out

On May 25, 2010, at 10:19 PM, Gregory Collins wrote:

But, if we are converting the existing happstack Response type into a  
snap Response, then we wouldn't be able to use iteratees?

Also, it just complicates the code even more than it already is. Adds  
even more monads!

What is the advantage of doing things that way over just using the  
snap Request/Response types natively?

It would be useful if we simply want to use some existing happstack  
code in a snap application. But the goal is to 'permanently' improve  
the the happstack server backend and get rid of the existing lazy I/O  
code altogether..

- jeremy


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeremy Shaw  
View profile  
 More options May 26 2010, 12:02 am
From: Jeremy Shaw <jer...@n-heptane.com>
Date: Tue, 25 May 2010 23:02:46 -0500
Local: Wed, May 26 2010 12:02 am
Subject: Re: Happstack website design and brand identity -- an offer to help out

On May 25, 2010, at 10:20 PM, Gregory Collins wrote:

I assume you are asking why we don't use chunked transfer encoding  
when we don't know the length so that we can support keep-alive even  
in that case?

I think it's because all the people interested in writing low-level  
http server code are working on their own servers instead of  
contributing to happstack :p

It's not too late though, you can still submit a patch ;)

- jeremy


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gregory Collins  
View profile  
 More options May 26 2010, 10:38 am
From: Gregory Collins <g...@gregorycollins.net>
Date: Wed, 26 May 2010 10:38:13 -0400
Local: Wed, May 26 2010 10:38 am
Subject: Re: Happstack website design and brand identity -- an offer to help out

Jeremy Shaw <jer...@n-heptane.com> writes:
> But, if we are converting the existing happstack Response type into a
> snap Response, then we wouldn't be able to use iteratees?

Yeah it'd strictly be a compatibility layer.

> Also, it just complicates the code even more than it already is. Adds
> even more monads!

> What is the advantage of doing things that way over just using the
> snap Request/Response types natively?

You get to run existing happstack code without modification, that's it.

> It would be useful if we simply want to use some existing happstack
> code in a snap application. But the goal is to 'permanently' improve
> the the happstack server backend and get rid of the existing lazy I/O
> code altogether..

If you would want to move ServerPartT closer to Snap then you may as
well just *use* Snap, the monad is almost identical after all.

G
--
Gregory Collins <g...@gregorycollins.net>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gregory Collins  
View profile  
 More options May 26 2010, 10:38 am
From: Gregory Collins <g...@gregorycollins.net>
Date: Wed, 26 May 2010 10:38:47 -0400
Local: Wed, May 26 2010 10:38 am
Subject: Re: Happstack website design and brand identity -- an offer to help out

Jeremy Shaw <jer...@n-heptane.com> writes:
> I assume you are asking why we don't use chunked transfer encoding when we
> don't know the length so that we can support keep-alive even  in that case?

> I think it's because all the people interested in writing low-level http server
> code are working on their own servers instead of  contributing to happstack :p

> It's not too late though, you can still submit a patch ;)

Touche! :)

G
--
Gregory Collins <g...@gregorycollins.net>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeremy Shaw  
View profile  
 More options May 26 2010, 12:13 pm
From: Jeremy Shaw <jer...@n-heptane.com>
Date: Wed, 26 May 2010 11:13:05 -0500
Local: Wed, May 26 2010 12:13 pm
Subject: Re: Happstack website design and brand identity -- an offer to help out

On May 26, 2010, at 9:38 AM, Gregory Collins wrote:

>> It would be useful if we simply want to use some existing happstack
>> code in a snap application. But the goal is to 'permanently' improve
>> the the happstack server backend and get rid of the existing lazy I/O
>> code altogether..

> If you would want to move ServerPartT closer to Snap then you may as
> well just *use* Snap, the monad is almost identical after all.

I don't want to move ServerPartT closer to the Snap monad. The Snap  
monad is basically ServerPartT without it's monad transformer powers.  
We already have that, it's called, "ServerPart".

In fact, we can use a newtype wrapper so that type errors are  
friendlier, and make ServerPartT look every bit as simple as the Snap  
monad. (Note: this version doesn't store the Response in a State  
monad, but that could be done too).

http://hpaste.org/fastcgi/hpaste.fcgi/view?id=25721

Alas, when you look at the current version of simpleHTTP it is easy to  
get distracted by all those WebT and UnWebT and ununWebT things that  
really don't belong in that file. And the documentation does not  
really guide you in the right direction either.

The plan for 0.6 has been to refactor that stuff out, and then  
properly document happstack so that people are only exposed to  
'ServerPart'. Later they can use the monad transformers, and various  
types classes, if they want. (I do use those features, and am glad to  
have them). Or they can just stick with ServerPart.

As for using the snap-backend: The aim is not to change ServerPartT  
monad, but to change the happstack Request type so that the rqBody is  
an iteratee instead of a lazy bytestring. (and some similar changes to  
the Request type). For that I think we need a library that exposes  
just four things:

  1. Response type
  2. Request type
  3. Config type
  4. run :: Config -> (Request -> IO Response) -> IO ()

I can get all those things out of the snap-core + snap-server  
libraries. But, I am concerned that as snap grows, I will start  
needing a bunch of extra dependencies that have nothing to do with  
those 4 features.. :-/

- jeremy


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
MightyByte  
View profile  
 More options May 26 2010, 1:00 pm
From: MightyByte <mightyb...@gmail.com>
Date: Wed, 26 May 2010 13:00:55 -0400
Local: Wed, May 26 2010 1:00 pm
Subject: Re: Happstack website design and brand identity -- an offer to help out

On Wed, May 26, 2010 at 12:13 PM, Jeremy Shaw <jer...@n-heptane.com> wrote:
> As for using the snap-backend: The aim is not to change ServerPartT monad,
> but to change the happstack Request type so that the rqBody is an iteratee
> instead of a lazy bytestring. (and some similar changes to the Request
> type). For that I think we need a library that exposes just four things:
>  1. Response type
>  2. Request type
>  3. Config type
>  4. run :: Config -> (Request -> IO Response) -> IO ()
> I can get all those things out of the snap-core + snap-server libraries.
> But, I am concerned that as snap grows, I will start needing a bunch of
> extra dependencies that have nothing to do with those 4 features.. :-/

The bulk of new development for Snap will happen outside of snap-core
and snap-server.  We're sensitive to dependency creep and intend to
keep -core and -server is simple as possible.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Johan Tibell  
View profile  
 More options May 26 2010, 3:54 pm
From: Johan Tibell <johan.tib...@gmail.com>
Date: Wed, 26 May 2010 21:54:48 +0200
Local: Wed, May 26 2010 3:54 pm
Subject: Re: Happstack website design and brand identity -- an offer to help out

On Wed, May 26, 2010 at 1:31 AM, Jeremy Shaw <jer...@n-heptane.com> wrote:
> It is certainly tempting.  I have been hoping to port to hyena for a long
> time, but that project seems a bit stalled perhaps?

Unfortunately I haven't had any time to work on Hyena for a long time. I've
been yak shaving, trying to improve the GHC I/O manager so that all Haskell
web servers can benefit from better performance (if you want to help please,
please try out the code on github [1] and report bugs). I still like to
write a iteratee based HTTP server that does only HTTP (i.e. it's not a web
framework) and does it well so that people can experiment with writing web
frameworks in Haskell without going through the pain of writing an HTTP
server (which you all know is tricky).

1. http://github.com/tibbe/event

Johan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gregory Collins  
View profile  
 More options May 26 2010, 10:48 pm
From: Gregory Collins <g...@gregorycollins.net>
Date: Wed, 26 May 2010 22:48:34 -0400
Local: Wed, May 26 2010 10:48 pm
Subject: Re: Happstack website design and brand identity -- an offer to help out

Jeremy Shaw <jer...@n-heptane.com> writes:
> I can get all those things out of the snap-core + snap-server
> libraries. But, I am concerned that as snap grows, I will start
> needing a bunch of extra dependencies that have nothing to do with
> those 4 features.. :-/

The snap-core library is going to stay roughly where it is going forward
-- probably any additional utilities to go in there will be in the
"doesn't introduce additional dependencies" category. We're planning on
putting Snap's more "frameworky" stuff in other packages.

G
--
Gregory Collins <g...@gregorycollins.net>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Don Stewart  
View profile  
 More options May 26 2010, 10:52 pm
From: Don Stewart <d...@galois.com>
Date: Wed, 26 May 2010 19:52:43 -0700
Local: Wed, May 26 2010 10:52 pm
Subject: Re: Happstack website design and brand identity -- an offer to help out
greg:

> Jeremy Shaw <jer...@n-heptane.com> writes:

> > I can get all those things out of the snap-core + snap-server
> > libraries. But, I am concerned that as snap grows, I will start
> > needing a bunch of extra dependencies that have nothing to do with
> > those 4 features.. :-/

> The snap-core library is going to stay roughly where it is going forward
> -- probably any additional utilities to go in there will be in the
> "doesn't introduce additional dependencies" category. We're planning on
> putting Snap's more "frameworky" stuff in other packages.

This was a huge lesson from xmonad: keep the dependencies very light for
basic functionality, or the distros -- and thus users and end-user
facing apps  -- can't keep up.

-- Don


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gracjan Polak  
View profile  
 More options May 27 2010, 6:11 am
From: Gracjan Polak <gracjanpo...@gmail.com>
Date: Thu, 27 May 2010 03:11:07 -0700 (PDT)
Local: Thurs, May 27 2010 6:11 am
Subject: Re: Happstack website design and brand identity -- an offer to help out

On 26 Maj, 21:54, Johan Tibell <johan.tib...@gmail.com> wrote:

> Unfortunately I haven't had any time to work on Hyena for a long time. I've
> been yak shaving, trying to improve the GHC I/O manager so that all Haskell
> web servers can benefit from better performance (if you want to help please,
> please try out the code on github [1] and report bugs).

I find your work on GHC I/O really interesting and important. It seems
to be a bit above my level of Haskell expertise, though. Anyway if you
need assistance with for example Windows port or testing I'd glad to
help.

--
Gracjan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Johan Tibell  
View profile  
 More options May 27 2010, 6:39 am
From: Johan Tibell <johan.tib...@gmail.com>
Date: Thu, 27 May 2010 12:39:05 +0200
Local: Thurs, May 27 2010 6:39 am
Subject: Re: Happstack website design and brand identity -- an offer to help out

On Thu, May 27, 2010 at 12:11 PM, Gracjan Polak <gracjanpo...@gmail.com>wrote:

The event lib offers a subset of the interface in GHC.Conc. GHC.Conc will be
implemented in terms of this smaller interface once the new I/O manager has
been merged into base. You can play with this interface today. It's defined
in

    http://github.com/tibbe/event/blob/master/src/System/Event/Thread.hs

This interface can in turn be used to implement the network-bytestring
interface and we've already done so:

    http://github.com/tibbe/event/blob/master/benchmarks/EventSocket.hs

Using the function in EventSocket it's possible to build a server in typical
Haskell style, using forkIO to handle each request. Bryan wrote a small HTTP
server using this interface

    http://github.com/tibbe/event/blob/master/benchmarks/StaticHttp.hs

Running this server (it can be built using the Makefile) could help us find
bugs on different platforms. For Windows support we still need to write a
select() backend. This should be pretty easy as it can be modelled after the
poll backend:

    http://github.com/tibbe/event/blob/master/src/System/Event/Poll.hsc


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gregory Collins  
View profile  
 More options May 27 2010, 9:18 am
From: Gregory Collins <g...@gregorycollins.net>
Date: Thu, 27 May 2010 09:18:21 -0400
Local: Thurs, May 27 2010 9:18 am
Subject: Re: Happstack website design and brand identity -- an offer to help out

Johan Tibell <johan.tib...@gmail.com> writes:
> Running this server (it can be built using the Makefile) could help us
> find bugs on different platforms. For Windows support we still need to
> write a select() backend. This should be pretty easy as it can be
> modelled after the poll backend:

For Windows we really should be using I/O completion ports. Huge pain
in the butt though!

G
--
Gregory Collins <g...@gregorycollins.net>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Johan Tibell  
View profile  
 More options May 27 2010, 9:49 am
From: Johan Tibell <johan.tib...@gmail.com>
Date: Thu, 27 May 2010 15:49:29 +0200
Local: Thurs, May 27 2010 9:49 am
Subject: Re: Happstack website design and brand identity -- an offer to help out

On Thu, May 27, 2010 at 3:18 PM, Gregory Collins <g...@gregorycollins.net>wrote:

> Johan Tibell <johan.tib...@gmail.com> writes:

> > Running this server (it can be built using the Makefile) could help us
> > find bugs on different platforms. For Windows support we still need to
> > write a select() backend. This should be pretty easy as it can be
> > modelled after the poll backend:

> For Windows we really should be using I/O completion ports. Huge pain
> in the butt though!

I agree. It would probably change the design though as they work
differently, as far as I understand, than the *nix APIs. In the end we
decided that select() will have to be good enough for Windows for now. Is
anyone writing high-performance servers for Windows?

Johan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeremy Shaw  
View profile  
 More options May 27 2010, 12:33 pm
From: Jeremy Shaw <jer...@n-heptane.com>
Date: Thu, 27 May 2010 11:33:12 -0500
Local: Thurs, May 27 2010 12:33 pm
Subject: Re: Happstack website design and brand identity -- an offer to help out

On May 27, 2010, at 5:39 AM, Johan Tibell wrote:

> Using the function in EventSocket it's possible to build a server in  
> typical Haskell style, using forkIO to handle each request. Bryan  
> wrote a small HTTP server using this interface

>     http://github.com/tibbe/event/blob/master/benchmarks/StaticHttp.hs

I tested this server with and without the USE_GHC_IO_MANAGER flag. It  
works fine both ways, though I saw nearly identical performance. Is  
that expected or am I doing something wrong? I am using GHC 6.13.

- jeremy


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gregory Collins  
View profile  
 More options May 27 2010, 1:09 pm
From: Gregory Collins <g...@gregorycollins.net>
Date: Thu, 27 May 2010 13:09:39 -0400
Local: Thurs, May 27 2010 1:09 pm
Subject: Re: Happstack website design and brand identity -- an offer to help out

Jeremy Shaw <jer...@n-heptane.com> writes:
> On May 27, 2010, at 5:39 AM, Johan Tibell wrote:

>     Using the function in EventSocket it's possible to build a server in typical Haskell style, using forkIO to handle each request. Bryan wrote a small HTTP server using this
>     interface

>         http://github.com/tibbe/event/blob/master/benchmarks/StaticHttp.hs

> I tested this server with and without the USE_GHC_IO_MANAGER flag. It
> works fine both ways, though I saw nearly identical performance. Is
> that expected or am I doing something wrong? I am using GHC 6.13.

You won't see much a difference unless you push it past 1024 open
connections -- event-based server will keep processing requests,
GHC-IO-manager-based-server will start refusing requests.

G
--
Gregory Collins <g...@gregorycollins.net>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeremy Shaw  
View profile  
 More options May 27 2010, 1:17 pm
From: Jeremy Shaw <jer...@n-heptane.com>
Date: Thu, 27 May 2010 12:17:28 -0500
Local: Thurs, May 27 2010 1:17 pm
Subject: Re: Happstack website design and brand identity -- an offer to help out

On May 27, 2010, at 12:09 PM, Gregory Collins wrote:

When I tried that I got,

~/n-heptane/projects/haskell/event/benchmarks $ ./static-http
static-http: accept: resource exhausted (Too many open files)

:-/

- jeremy


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matthew Elder  
View profile  
 More options May 27 2010, 2:05 pm
From: Matthew Elder <m...@mattelder.org>
Date: Thu, 27 May 2010 11:05:35 -0700
Local: Thurs, May 27 2010 2:05 pm
Subject: Re: Happstack website design and brand identity -- an offer to help out

you must increase the limit of open files for your user with ulimit

--
Need somewhere to put your code? http://patch-tag.com
Want to build a webapp? http://happstack.com

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matthew Elder  
View profile  
 More options May 27 2010, 2:05 pm
From: Matthew Elder <m...@mattelder.org>
Date: Thu, 27 May 2010 11:05:49 -0700
Local: Thurs, May 27 2010 2:05 pm
Subject: Re: Happstack website design and brand identity -- an offer to help out

by default its usually 1024

--
Need somewhere to put your code? http://patch-tag.com
Want to build a webapp? http://happstack.com

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matthew Elder  
View profile   Translate to Translated (View Original)
 More options May 27 2010, 2:06 pm
From: Matthew Elder <m...@mattelder.org>
Date: Thu, 27 May 2010 11:06:53 -0700
Local: Thurs, May 27 2010 2:06 pm
Subject: Re: Happstack website design and brand identity -- an offer to help out

use this to find out what your current limit is:
 ulimit -n

--
Need somewhere to put your code? http://patch-tag.com
Want to build a webapp? http://happstack.com

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Johan Tibell  
View profile  
 More options May 27 2010, 3:38 pm
From: Johan Tibell <johan.tib...@gmail.com>
Date: Thu, 27 May 2010 21:38:43 +0200
Local: Thurs, May 27 2010 3:38 pm
Subject: Re: Happstack website design and brand identity -- an offer to help out

On Thu, May 27, 2010 at 7:17 PM, Jeremy Shaw <jer...@n-heptane.com> wrote:
> On May 27, 2010, at 12:09 PM, Gregory Collins wrote:
> You won't see much a difference unless you push it past 1024 open

>> connections -- event-based server will keep processing requests,
>> GHC-IO-manager-based-server will start refusing requests.

> When I tried that I got,

> ~/n-heptane/projects/haskell/event/benchmarks $ ./static-http
> static-http: accept: resource exhausted (Too many open files)

Setting up your kernel for high performance networking is a bit tricky. We
created a helper program to make it easier:

    http://github.com/tibbe/event/blob/master/benchmarks/benchmark_shell.py

Simply run

    benchmark_shell.py <command>

to run command (e.g. a binary like static-http) in an environment suitable
for a high performance server.

Johan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages < Older 
« Back to Discussions « Newer topic     Older topic »