I've created an Ubuntu DEB package for flashpolicytwistd - a simple Flash Policy Server written in Python/Twisted. This simplifies installation process a lot.
Find the deb at project's download page.
I'll share some bits of IT knowledge here: CScience, WEB, Networking, Python, C++, Unix, Linux, Ubuntu, etc.
Показаны сообщения с ярлыком twisted. Показать все сообщения
Показаны сообщения с ярлыком twisted. Показать все сообщения
среда, 23 декабря 2009 г.
пятница, 16 октября 2009 г.
Flash policy server
Flash player uses policy server to check its permission to open sockets to certain ports of certain server.
Adobe provides sample Flash policy server. But it is unusable for production. It creates a thread per connection. Also it shows strange virtual memory usage.
That is why I wrote simple flashpolicytwistd using Python/Twisted.
Adobe provides sample Flash policy server. But it is unusable for production. It creates a thread per connection. Also it shows strange virtual memory usage.
That is why I wrote simple flashpolicytwistd using Python/Twisted.
понедельник, 20 июля 2009 г.
Twisted logging pitfall
I run my Twisted processes as
Twisted chops and rotates log files by itself. By default it generates 10mb files chunks.
When current somelogfile.log becomes larger than 10mb, Twisted moves it to somelogfile.log.1 and continues logging to an empty file. If there are more than 2 chunks, they get their names so that larger number at the end corresponds to an older log. To achieve this, Twisted renames N log files, where N is the number of chunks.
In my system there were tens thousands of chunks. I did even realize that rotating them makes a huge stress for HDD, causing unexpected IOWAIT peaks. Moving the chunks to a separate folder eliminated the problem, preventing me from buying some more hardware :)
I'll investigate if it is possible to use logrotated or something similar to handle all this automatically.
twistd --logfile /var/log/somelogfile.log --pidfile /var/run/somepidfile.pid -y sometacfile.tac
Twisted chops and rotates log files by itself. By default it generates 10mb files chunks.
When current somelogfile.log becomes larger than 10mb, Twisted moves it to somelogfile.log.1 and continues logging to an empty file. If there are more than 2 chunks, they get their names so that larger number at the end corresponds to an older log. To achieve this, Twisted renames N log files, where N is the number of chunks.
In my system there were tens thousands of chunks. I did even realize that rotating them makes a huge stress for HDD, causing unexpected IOWAIT peaks. Moving the chunks to a separate folder eliminated the problem, preventing me from buying some more hardware :)
I'll investigate if it is possible to use logrotated or something similar to handle all this automatically.
Подписаться на:
Сообщения (Atom)