Lucca, What happend if the DB server is not up? Thanks, Ale 2013/8/6 Basil Mohamed Gohar <basilgohar at librevideo.org>> On 08/06/2013 02:09 PM, Luca Cireddu wrote: > > Just a little preview of the browsing interface: > > https://github.com/sardylan/icecast-mysql-phpstats/wiki > > > > As you can see, I created a new repository for the PHP part of stats. > > > > Luca. > > > > _______________________________________________ > > Icecast-dev mailing list > > Icecast-dev at xiph.org > > http://lists.xiph.org/mailman/listinfo/icecast-dev > > > Honestly, that doesn't look too shabby. I've been interested in this > project since you first mentioned it, but I've not had the time to > contribute, so I kept silent. But the screenshots make me even more > interested in the project as a whole. > > -- > Libre Video > http://librevideo.org > _______________________________________________ > Icecast-dev mailing list > Icecast-dev at xiph.org > http://lists.xiph.org/mailman/listinfo/icecast-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/icecast-dev/attachments/20130806/369949a6/attachment.htm
Icecast tries to ping MySQL DB every 10 seconds (#define MYSQLSTATS_DBCHECK_INTERVAL 10) using mysql_ping() native function. If the DB doesn't answer, it closes the connection calling mysqlStatsDBClose() to free memory and wait for the next ping. The next time, it will find the DB connection closed so it tries to reopen it to have MySQL Stats working again, but there is an increment of an internal counter. Icecast tries to "reopen" MySQL connection for a maximum of 3 times, as defined in MYSQLSTATS_DBCHECK_RETRY_MAX. During the mysql-down period, all functions related to MySQL are skipped automatically using a global variable called mysqlstats_enabled. All statements regarding this variable, including conditional checks and assignments, are included between mutex lock and unlock, so there isn't the possibility that the connection is voluntarily closed during other threads' operations. After 3 retries, MySQL Stats are definitively disabled, and you have to restart icecast daemon to get stats working again, but all native icecast functions continue to work as usual. It's a temporary solution, but it's working fine. Another way could be to retry indefinitely, or defining MYSQLSTATS_DBCHECK_RETRY_MAX to 1000 or some high value. You can change this value in mysqlstats.h Bye. Luca On 08/06/2013 08:27 PM, Alejandro wrote:> Lucca, > > What happend if the DB server is not up? > > Thanks, > Ale
Hi all, still very busy at work in this period... I updated icecast-mysql fork with new modifications from version 2.4.0. You can find it in public GitHub repository. I tried to compile updated code without problems, but I still have to test it. If someone is going to use this version, please let me know any bug or suggestion. Ciao. Luca