Re: [Haskell-cafe] Light and fast http server
On Sat, Mar 12, 2011 at 9:00 PM, Jeremy Shaw wrote: > > On Mar 11, 2011, at 4:39 PM, Victor Oliveira wrote: > >> Hi cafe, >> >> There are a lot of http servers in hackage. I didn't have used none. >> I would like to know if one of them is something closer of the nginx. >> I need some light and fast. It don't need support all http, just the >> basics is fine. >> Suggestions? > > What do you mean by 'the basics'? > > happstack, yesod, and snap are all frameworks for building web applications. > > But it sounds like you are just looking for a web server to server static > content for the disk? If so, what is the advantage you hope to get by using > Haskell over nginx ? > > Any of the high-level frameworks can server static content pretty trivially. > For example in Happstack you would just do: > >> module Main where >> >> import Happstack.Server (Browsing(EnableBrowsing), nullConf, >> serveDirectory, simpleHTTP) >> >> main :: IO () >> main = simpleHTTP nullConf $ serveDirectory EnableBrowsing [] "." > To serve files from the current directly. > If that is all you really need, then I would probably recommend warp + > wai-app-static, > http://hackage.haskell.org/package/wai-app-static > Warp is pretty darn fast. Though, in practice I think you will find that all > of the frameworks/servers are going to have very similar results for serving > static files since they all call sendfile() to do the bulk of the transfer. > If you are looking for other features, then you need to say what those > features are.. > - jeremy Minor post-script: if all you need is warp + wai-app-static without any custom code, then you can just use the warp-static[1] package. I mostly just use this when testing HTML bundles on my work system and need to serve from a web server to bypass Javascript-from-file:// issues. In production, if you really just need static file serving, I would also tend to recommend nginx instead. Michael [1] http://hackage.haskell.org/package/warp-static ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Light and fast http server
On Mar 11, 2011, at 4:39 PM, Victor Oliveira wrote: Hi cafe, There are a lot of http servers in hackage. I didn't have used none. I would like to know if one of them is something closer of the nginx. I need some light and fast. It don't need support all http, just the basics is fine. Suggestions? What do you mean by 'the basics'? happstack, yesod, and snap are all frameworks for building web applications. But it sounds like you are just looking for a web server to server static content for the disk? If so, what is the advantage you hope to get by using Haskell over nginx ? Any of the high-level frameworks can server static content pretty trivially. For example in Happstack you would just do: > module Main where > > import Happstack.Server (Browsing(EnableBrowsing), nullConf, serveDirectory, simpleHTTP) > > main :: IO () > main = simpleHTTP nullConf $ serveDirectory EnableBrowsing [] "." To serve files from the current directly. If that is all you really need, then I would probably recommend warp + wai-app-static, http://hackage.haskell.org/package/wai-app-static Warp is pretty darn fast. Though, in practice I think you will find that all of the frameworks/servers are going to have very similar results for serving static files since they all call sendfile() to do the bulk of the transfer. If you are looking for other features, then you need to say what those features are.. - jeremy ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Light and fast http server
snap or warp/yesod. maybe in a few years we will have a winner for the platform... --dons On Friday, March 11, 2011, Vo Minh Thu wrote: > 2011/3/11 Victor Oliveira : >> Hi cafe, >> >> There are a lot of http servers in hackage. I didn't have used none. >> I would like to know if one of them is something closer of the nginx. >> I need some light and fast. It don't need support all http, just the basics >> is fine. >> Suggestions? > > Snap and Warp come to mind. Have a look at this reddit thread: > http://www.reddit.com/r/programming/comments/flpao/the_haskell_high_performance_server_shootout/ > > Cheers, > Thu > > ___ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Light and fast http server
2011/3/11 Victor Oliveira : > Hi cafe, > > There are a lot of http servers in hackage. I didn't have used none. > I would like to know if one of them is something closer of the nginx. > I need some light and fast. It don't need support all http, just the basics > is fine. > Suggestions? Snap and Warp come to mind. Have a look at this reddit thread: http://www.reddit.com/r/programming/comments/flpao/the_haskell_high_performance_server_shootout/ Cheers, Thu ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe