Apache -vs- Yaws

Jun 28, 12:03 pm

So, someone has decided to do a performance test between Apache and Yaws. Simply put, this is absolutely worthless. Yes, Yaws performs much better under high load. Is there any surprise there? The greatness of Apache is not in its ability to perform stellar under high loads. It is in its versatility.

Do you realize the pain you have to go through in order to do any simple task in Yaws? For example, let’s set a cookie!

session(A, Visits) ->
    receive
{From, tick} ->
    N = calendar:local_time(),
    From ! {self(), [N|Visits]},
    session(A, [N|Visits])
    after 60000 ->    %% keep state for 60 secs only
    exit(normal)
    end.
	

out(A) -> H = A#arg.headers, C = H#headers.cookie, case yaws_api:find_cookie_val("foobar", C) of
[] -> Now = calendar:local_time(), P = spawn(fun() -> session(A, [Now]) end), yaws_api:setcookie("foobar", pid_to_list(P), "/");
PidStr -> Pid = list_to_pid(PidStr), case process_info(Pid, messages) of
undefined -> Now = calendar:local_time(), P = spawn(fun() -> session(A, [Now]) end), yaws_api:setcookie("foobar", pid_to_list(P), "/");
_ -> ok end end.

Are you still sure Yaws is so much better than Apache? Yes, a high performance web server such as Yaws has its place. It can be useful for serving up all types of content, but it is not particularly useful for most common web developers. If someone really wants to do a comparison of the two, please take into account all the features that Apache has that Yaws does not. Please take into account all the modules that you can use with Apache that you can’t with Yaws.


    1. Paul says:

      Looks pretty easy to me

      yaws_api:setcookie(“foobar”,pid_to_list(P),”/”);



    1. Okay there is the code for setting a cookie in plain yaws code.

      Now what would that look in apache code?

      Oh I forgot – with apache you have to code the cookie interface and implementation totally with C/cgi or use some third party pre-written C extension like PHP.

      That is totally apples and oranges comparison.




Add your comments

Please keep your comments relevant to this blog entry: inappropriate or purely promotional comments may be removed. To add hyperlink, please follow this example: "your link text":http://your.link.url