martedì, 24 febbraio 2009
Hello folks!
I've made a new patch to fit new ejabberd 2.0.3.
The file can be found
here
Hope it works for you all.
sabato, 07 febbraio 2009
A little bit of Zeak (JsJaC) posted this note about ejabberd memory leak and a possible bug fix in Erlang OTP/R12B:
http://blog.jwchat.org/2009/01/14/ejabberd-memory-leak/
The problem regards how R12 does garbage collecting as we read here:
http://erlang.org/pipermail/erlang-questions/2008-July/036559.html
Well, I'm managing a large cluster of ejabberd servers installation for server-side development and I experienced a similar (very) fastidious memory leak, due to a large amount of HTTP-POLL client connections (JSJaC library), These TCP connections seems to not be closed on the server side modules (ERLANG modules), causing memory crunching (over one gig) and finally the OOM kills the BEAM process.
As we read in the R12B release notes there was this fix too:
"OTP-7615 Fixed memory leak of unclosed TCP-ports. A gen_tcp:send()
followed by a failing gen_tcp:recv() could in some cases
cause the port to linger after being closed."
A hard solution (
stefko) was to cron the Ejabberd restart every hour, in order to avoid the OOM to kill it and go out of service.
I updated all cluster's nodes to ERLANG OTP/R12B, and I'm monitoring the cluster memory to check the fix gone.
Currently I'm running ejabberd 1.1.3 and the ajax client uses JSJaC 1.3.2.
LP
The Erlang OTP/R12B release notes:
http://erlang.org/download/otp_src_R12B-5.readme
The Ejabberd HTTP-POLL:
http://www.ejabberd.im/node/94
JSJaC XMPP Client LIB:
http://blog.jwchat.org/jsjac/
venerdì, 30 maggio 2008
A copy of "Programming Erlang, Software for A Concurrent World" by Mr. Joe Armstrong just landed in my lucky hands! I can't wait to read and learn from Erlangs'creator :)
I'm writing the introduction:
The World is parallel.
If we want to write programs that behave as other objects behave in
the real world, then these programs will have a concurrent structure.
Use a language that was designed for writing concurrent applications,
and development becomes lot easier.
Erlang programs model how we think and interact
mercoledì, 23 aprile 2008
In Erlang we can use many method to access to lists and tuples, and some of them are very quick and easy.
With ++ and -- operators you can add and subtract lists, like in the following example:
Thelist=[1,2,3,4,5,6,7,8,9,10],
Even = lists:filter(fun(E) ->
E rem 2 == 0
end,
Thelist),
Odd=Thelist -- Even,
Newlist = Odd ++ [ one, five ].
So Odd list will contains [1,3,5,7,9], Even list will contains [2,4,6,8,10] and Newlist will contain [1,3,5,7,9,one,five].
lunedì, 07 aprile 2008
I've recently been involved in the problem of Flash (7.0 and following) XML socket.
Flash uses a "strange" kind of packet transfer in XML socket so Ejabberd 2.0.0 is not compatible with some Flash version.
I've seen a patch for Ejabberd 1.1.X versions and I've adapted it to fit with ejabberd 2.0.0.
Please note that this patch changes configure.ac file, but you must DO NOT run aclocal command.
At the moment
aclocal.m4 file contains some macro that
aclocal command will overwrite!
So please follow these steps to apply this patch to Ejabberd 2.0.0:
patch -p0 <flash-xml-ejabberd-2.0.0.diff
rm configure
autoconf
./configure --enable-flash-hack
make
And you'll be able to use XMPP like this:
<?xml version='1.0'?>
<flash:stream to='example.net' xmlns='jabber:client'
xmlns:flash='http://www.jabber.com/streams/flash' version='1.0'>
</flash:stream>
The patch is available here.
lunedì, 07 aprile 2008
As promised I'm releasing the cookie patch for ejabberd 2.0. The patch is quite simple and takes few minutes to check it out.
To apply the patch cumulatively, simply do the following
ejabberd/src/web/ $ patch < $HOME/ejabberd-2.0-cookie.patch
Otherwise you could apply the patch to single files:
ejabberd/src/web/ $ patch ejabberd_http.hrl $HOME/ejabberd_http_hrl.patch
ejabberd/src/web/ $ patch ejabberd_http.erl $HOME/ejabberd_http_erl.patch
Let me know if you got errors applying this patch.
Links:
ejabberd 2.0 Cumulative Cookie Patch
ejabberd_http Source Cookie Patch
ejabberd_http Header Cookie Patch
mercoledì, 26 marzo 2008
There's a very useful method to dynamically change verbosity level in ejabberd 2.0.0.
You must connect with a remote shell to the node you're interested to debug and simply write:
ejabberd_loglevel:set(LogLevel).
Where LogLevel is:
- 0: No ejabberd log at all (not recommended)
- 1: Critical
- 2: Error
- 3: Warning
- 4: Info
- 5: Debug