|
|
| Author |
Message |
< Yaws mailing list ~ update_total() consumes memory without bound |
| Guest |
Posted: Wed Jan 31, 2007 12:43 am |
|
|
|
Guest
|
I'm using Yaws 1.65 to provide a REST interface to a stateful
web-service. The API is basic PUT/GET, working on hundreds of of
millions of key/values. URLs are maybe 30 characters long.
In yaws_serverl.erl, the call to update_total/2 in url_type/2 causes a
'urlc_total' entry for _every_ new URL to be inserted into the
yaws_code ETS table, consuming memory like crazy, quickly killing
performance (we are doing hundreds of writes per second), and
eventually killing the VM.
This happens even if all of the cache size/options are set to 0 (disabled).
I don't have a patch to offer (other than commenting this line, which
completely fixes the problem), as I don't use the cache feature. So I
don't know what the 'correct\ fix might be. Presumably update_total()
should enforce a limit on the number of entries it inserts.
regards,
Chris Newcombe
Yaws 1.65, exerpt from yaws_serverl.erl
%% a file cache
url_type(GetPath, ArgDocroot) ->
SC=get(sc),
GC=get(gc),
E = SC#sconf.ets,
%%%update_total(E, GetPath), % this call consumes memory
without bound
case ets:lookup(E, {url, GetPath}) of
...snip...
update_total(E, Path) ->
case (catch ets:update_counter(E, {urlc_total, Path}, 1)) of
{'EXIT', _} ->
ets:insert(E, {{urlc_total, Path}, 1});
_ ->
ok
end.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post recived from mailinglist |
|
|
| Back to top |
|
|
|
All times are GMT
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|
|