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.

Aug 31, 08:34 am
Looks pretty easy to me
yaws_api:setcookie(“foobar”,pid_to_list(P),”/”);