Normally when running an Erlang application (like Ejabberd) using Mnesia internal database in a heavy loaded environment you run into the following log message:
=ERROR REPORT==== 23-Jun-2010::00:59:19 ===
Mnesia(node@server): ** WARNING ** Mnesia is overloaded: {dump_log, write_threshold}
This warning event is usually shown when using mnesia disc_copies tables and doing a lot of writes to disk all at once (considering you are using asynchronous writes), and of course it can get really annoying when they start happening every second. We can drastically reduce the occurrence of this error changing 2 configuration parameters, the dc_dump_limit and dump_log_write_threshold.
dc_dump_limit
This parameter controls how often disc_copies tables are dumped from memory, the default value is 4 that means if the log size is greater than the table size divided per 4 (table size / 4) it starts the dump. You can make dumps happen more often increasing this value.
dump_log_write_threshold
This parameter defines the maximum number of writes to the transaction log before a new dump is performed, using the default value 100 a new transaction log dump is performed after every 100 writes. You can increase this value giving more time to the write process to finish, but be sure that you have enough RAM on your server to maintain the transactions running.
And now, what does it mean?
Mnesia activity is recorded in transaction logs, that gets dumped to table logs, which in turn are dumped to table files on disk. By increasing the dump_log_write_threshold, transaction logs are dumped much less often, giving more time to the last dump be completed before the next dump is triggered. By the way, increasing the dc_dump_limit helps ensure that the disk table is dumped form the logs more often.
You can configure the parameters using the following syntax:
{mnesia, [{dc_dump_limit, 40}, {dump_log_write_threshold, 50000}]}
* Remember to change the values according to your needs!
Recently I got an error while running some Python scripts on a Red Hat Enterprise Linux 3, specifically when importing the MySQLdb module, with the the following error:
ImportError: cannot import name ImmutableSet
After some research I found that when upgrading the module to version 1.2.1 (or newer) the file sets.py, that was used on 1.2.0 or prior versions, still on system and this doesn’t contain ImmutableSet that’s defined as a default bult-in set in the recent versions of MySQLdb.
To solve this problem (tested on Python 2.4 and 2.6) just remove the sets.py from your MySQLdb installation directory.
Yesterday I was compilling a new release of PHP packages for Red Hat Enterprise 5 (RPM) in the x86_64 architecture and I got a bug during the compilation proccess of the php-mssql module that requires the freetds-devel package to be built.
By default, the configure script doesn’t find the required freetds libraries on the system (even if they are correctly installed) because in the lastest versions of freetds we don’t have the tds.h and libtds.a files.
To bypass this check and continue building your packages normally you can use this simple and dirty workarround:
$ touch /usr/include/tds.h
$ touch /usr/lib/libtds.a
Or you can edit the configure script (make a patch and apply during the build process) to find the correct files and directories.
Official report: http://bugs.php.net/bug.php?id=44991
Tanks to Brian for the help!
Recentemente realizamos a instalação do módulo Suhosin em todos os servidores da nova arquitetura de hospedagem da Locaweb de forma opcional para os clientes, porém boa parte dos desenvolvedores não conhece o potencial e as funcionalidades deste módulo que pode ser ativado facilmente em sua hospedagem compartilhada ou em seus próprios servidores.
Suhosin é um módulo avançado de proteção para servidores de aplicação rodando PHP, é foi desenvolvido para proteger tanto os servidores como os próprios desenvolvedores de vulnerabilidades nas aplicações construídas e no próprio core do PHP.
O módulo é compatível com instalações do PHP em qualquer sistema compatível, não apresentando problemas com outros módulos presentes na instalação, incluindo Zend Optimizer e APC.
Um dos recursos mais interessantes deste módulo é a encriptação transparente de cookies e dados de sessão, evitando inumeros ataques de “session hijacking” O módulo também realiza inumeros tipos de filtragem de dados em tempo real, evitando ataques DOS e scripts maliciosos sendo executados no servidor.
Para aqueles que precisam desenvolver aplicações em PHP com mais segurança em um ambiente controlado e auditado, o módulo é muito útil!
Ah sim, para aqueles que possuem planos de hospedagem Linux na Locaweb e desejam realizar a ativação do módulo, é necessário apenas adicionar a seguinte linha em seu arquivo php-cgi.ini:
extension=suhosin.so
Alguns dias atras resolvi instalar o Trac para gerenciar um projeto que desenvolvi, porem durante a instalacao resolvi armazenar meus dados em uma base PostgreSQL, e entao me deparei com a falta de um modulo para conexao Python com PostgreSQL presente na documentacao do Trac, o pyPgSQL.
Minha plataforma utilizada foi um RedHat Enterprise 5 rodando em 64bits, e acabei nao encontrando nenhum pacote pronto e atualizado para a instalacao. Para que nao fosse necessario compilar e instalar tudo manualmente resolvi criar o pacote com base em um spec ja existente e para aqueles que precisarem, vou disponibiliza-lo aqui para download:
Source: pyPgSQL-2.4-0.src.rpm
RedHat Advanced Server 5: pyPgSQL-2.4-0.x86_64.rpm