Archive for the ‘Develop’ Category

Hi All,

In these days I studied about HA of Plone. Some years ago I tested the same things using Oracle in an Enterprise context, so with licenced support of Oracle. Oracle has a client called instantclient, who hide any problem about the presence of more than a dbserver, so relstorage makes no difference between a local db and a cluster. So it was very easy.

With Postgres there’s pgpool, a tool to make the same thing, but I want to take some time to study repmgr, some kind of wrapper around PostgreSQL Hot standby.

The configuration is not so complicated but a little bit long and I don’t want to repeat every step, so: this is the guide about configure repmgr and postgresql:

About this guide, I have to say a couple of words:

  • is never shown but it may be something like this:
repmgr -f /etc/repmgr/repmgr.conf --verbose standby promote
/etc/init.d/postgresql restart
  • repmgr try to use pg_ctl: in debian this is not necessary available, so after clone command or promote (see before) is necessary to restart postgres by hand

If everything goes well, we now have 2 dbservers in Master/Slave mode using Streaming Replication. Well a few steps are necessary:

  • take a buildout for Plone: a new one or your favorite
  • locate the instance or the instances (sections with recipe plone.recipe.zope2instance)
  • add as usual, the relstorage support (be sure you get at least 1.5.1)
  • remove from DSN relstorage option, ‘host=…’
  • add option replica-conf (see relstorage documentation)
  • write a file in the root of buildout with the list of dbase ips, one for line
  • Buildout and enjoy

To get a really HA, you have to build at least two dbservers and two plone servers with public ip and a round robin DNS (are always in HA) to manage two or more ips for the same domain. To avoid the single point of failure is necessary to get a real HA.



Diazo: advanced use

Posted: 09/07/2012 in Develop
Tags: , , , ,

Here, there’a an article related an advanced use of Diazo. Soon, I will translate it from italian.

Chameleon and Plone

Posted: 16/01/2012 in Develop
Tags: , , ,

Plone uses page templates in a intensive way, so they have to work very fast. Chameleon is not a new solution for this kind of problems but it works on a Plone Vanilla out of the box. Some years ago I tested it on Plone 3.x but too much work was needed to fix all page templates, so it was aborted. I do not want to spend a time to explain how it works, you can read all about that at

I made some tests comparing Plone Vanilla with Plone + and these are the results:

Plone Vanilla
(first call)
(following calls)
Real 2.075 8.292 1.699
User 0.013 0.007 0.010
Sys 0.017 0.027 0.023

Times are in seconds and they are a result multiple invocation of

$ time wget -r -np

It is impressive, 15% faster than a Vanilla. A great strike in the match Compilers vs Interpreters 🙂 .



Posted: 15/11/2011 in Develop
Tags: , ,

Hi all,

after publication of collective.plone.reader (see previous post for details) I published an extension called collective.plone.mailer. This one looks for all aggregators and for each ones create periodically an email reporting last updates to the owner. Recurrence is configurable for each aggregator.

There’s no configuration available on site, but every user can choose if he wants to receive the email.

It was develop for plone 3.5 so I’m no sure it works correctly on other versions.

Please report any experience.



Posted: 15/11/2011 in Develop
Tags: , ,

Hi All,

I uploaded on github a project of mine called collective.plone.reader.

This product realize a something like a plone topic (collection) not based on criteria but folder subscription.

It is very easy to use:

  • add to your working plone this product
  • install into plone the product (quickinstall)
  • every user needs to create an aggregator (portal type) keeping ownership

Now every user can navigate through the site and add contents to the aggregator using the related action (a star icon).

If you need, you can manipulate the setup of the product using portal_properties: access to ZMI/portal_properties, select  collective.plone.reader_properties properties sheet.

Here you can customize what you like:

  • enabled_types: list of content types you want to aggregate
  • visible_contents: list of visible contents in the aggregator
  • mapping_content_to_index: list of mapping from portal types to catalog indexes, this is very useful when you use facets
  • other_options: list of options for solr, they are static

It was develop for plone 3.5, so I’m not sure it works correctly on following versions, if you got an experience please contact me.

An extension is available, it is called collective.plone.mailer. This package allows to send periodically an e-mail to the owner of an aggregator a report related aggregated contents.


Hi All,
the last day of the conference, all of us are tired because 5 days of conference are very tiring.

By the way,  I followed Alex Martelli about Design Pattern…. I hoped to get something better.

The main talk of the day was “0MQ”. This is a library cross language who wrap sockets, pipes, etc. Very interesting library but a little bit young, for example it didn’t support ssl natively, but it implements queues to make asynchronous communications. It implements too some comunications pattern as: client/server, one to more, farm (emitter, workers, collector) and else.

Dependency Injection was the title of last talk of the day. This talk wasn’t so technical and not so related to python but may be applied to many languages.

In the afternoon I left the conference bacause 5 days are too much :).


Hi All,
sorry for my delay to write the last two posts related EuroPython.

The forth day started with a sadly thing: the talk I wanted to follow was deleted, but I didn’t understand why, so I followed the one who replaced it. The topic was SQLKit, but I found it not very interesting but only another ORM for desktop application: it integrates sqlalchemy and pygtk to develop very fast. If you need that kind of applications, may be a good solution, but it didn’t impress me much.

After that, I followed an interesting talk about printing pdf documents by python. The talk was mainly a report about the author experience, not a really presentation of a product or solution.

Last talk of the day was related Tips and Tricks by Hettinger, and I think I say enough if you know Hettinger.
He talks about a set of collections that exists in collections python library: two hours really full of informations.

Nothing else. 🙂