Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: HTTP::Server::Simple forking/SSL/IPv6

by Anonymous Monk
on Oct 24, 2011 at 13:37 UTC ( #933400=note: print w/ replies, xml ) Need Help??


in reply to HTTP::Server::Simple forking/SSL/IPv6

How does it compare with the various Plack servers?


Comment on Re: HTTP::Server::Simple forking/SSL/IPv6
Re^2: HTTP::Server::Simple forking/SSL/IPv6
by cavac (Chaplain) on Oct 24, 2011 at 13:56 UTC

    To be absolutely honest: I have no idea.

    I started to develop a small in-house webservice with HTTP::Server::Simple::CGI and it grew over time to a big, mission critical central service. Since i started, i extended HSSC. A few days ago, at a request from a friend, i pulled the relevant code from Maplat and put it into it's own module.

    With HSSC it's somehow like a marriage. It's quite easy to start, but very time consuming and expensive to get rid of. And while it lasts, you get in trouble very quickly if you are unfaithful to your selected partner. So, no, i never took the time to compare with other frameworks.

    I can only say this for performance and stability: I'm running a webservice with about 50 users and like cyclic 300-500 automated clients without any troubles on a midrange linux server. And it only ever fails on me when i don't test my updates. Other than that, HSSC(P) runs quite smoothly.

    Don't use '#ff0000':
    use Acme::AutoColor; my $redcolor = RED();
    All colors subject to change without notice.

      Moving from HTTP::Server::Simple to a PSGI setup using Plack shouldn't be hard. In HTTP::Server::Simple(::CGI), you have the subroutine handle_request, which prints its output. In PSGI, you have an anonymous subroutine that returns the HTML to be sent.

      This is the part you need to change, instead of printing your HTML, you return a triplet of [ $status, $headers, $body ].

        Well, in my case there's probably a bit more work involved. I also do things like on-the-fly HTTP compression, keeping database connections open, etc...

        If i understand correctly, the various files are loaded on request and not on startup? Or am i misreading the documentation?

        If everything is in an anonymous subroutine, how does debugging work? With Maplat (my framework), i just start the script with the appropriate breakpoints set and then surf to the page i want to debug.

        Edit: On a personal note, Corion, i really love the Power-to-Ethernet cable on your homenode. Where can i get one?

        Don't use '#ff0000':
        use Acme::AutoColor; my $redcolor = RED();
        All colors subject to change without notice.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://933400]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2014-07-31 04:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (244 votes), past polls