[erlang-questions] mochiweb https/ssl

Chandru chandrashekhar.mullaparthi@REDACTED
Sat May 7 07:49:46 CEST 2011


Hi Sasa,

On 6 May 2011 23:33, sasa <sasa555@REDACTED> wrote:

>  On Fri, 2011-05-06 at 21:30 +0100, Chandru wrote:
>
>  I have then moved stunnel proxy to a separate server, and then it
> worked perfectly.
>
> Currently, I am suspecting that cpu load might be the problem. When I
> had stunnel on the same machine as erlang server, cpu load was going
> high. The same thing happened when I used erlang ssl. When stunnel is
> on a separate machine, the cpu load on both machines is fairly low.
>
>
> That is quite strange.  What is the spec of the machine? This might be a
> peculiarity of the virtual instances you get on EC2. Is there any chance you
> can repeat this test on dedicated hardware? When running both on the same
> machine, have you monitored which process eats more CPU? beam or stunnel?
>
>
> It is the "large" EC2 instance with two cores and 7.5 GB of memory. The
> same type of instance sustained 12 hours of http load testing with 20 000
> clients and is running the production system serving about 700 http users on
> average (about 1000 at the peak) since January this year.
> Unfortunately I don't have dedicated hardware available. On monday I will
> try to test it again using four cores instance on the server.
>

When you do this, try restricting the beam process to two cores and see if
you get the same performance as using separate machines. You can do this
using the '+S 2' option when starting the node.


>  I cannot explain why it works better with stunnel. Do I have to
> manually configure ssl sessions when using erlang? As I mentioned
> earlier, the client does long polling i.e. it sends an request, and as
> soon as the request is responded, the new one is made. Is it possible
> that ssl handhsake occurs for every request?
>
>
> I doubt the handshake occurs for every request. It might have something to
> do with the fact that stunnel is written in C so is likely to benefit in
> terms of performance. You could try hipe compilation of the ssl application
> to see if that gives you any better performance.
>
>
> Well it is the erlang client, and in fact, I'm using the ibrowse library
> and not httpc. There is no explicit ssl connection, but rather an infinite
> loop of https requests. At the client side, on what level is the SSL session
> being maintained: OS, erlang  or the http(s) library?
>

ibrowse also uses the in built ssl application, so the SSL session is being
maintained by the ssl application running within the beam process.

 I will try to hipe compile it, thank you for the suggestion. Are there any
> instructions out there, which you could recommend, or should I google it
> myself?
>

erl -man hipe :-)

cheers
Chandru
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110507/e09771f8/attachment.htm>


More information about the erlang-questions mailing list