Libzypp/BackendPerformance

Şuraya atla: kullan, ara

Using meanless tokens for external process operations

In this case, we will introduce the following actors.

  • zmd
  • zmd helpers
  • zypp

zmd must call a helper each time. The helper empties zmd database (for the specific catalog its going to re-fill), reads all the sources and inserts data into zmd database, even if the sources and system hasn't changed.

The helper can't know it. But it can be helped to keep a "remember". This token is meaningless for zmd.

  • zmd creates a random token and calls the helper
  • the helper checks the timestamp of the source(s) (which mean only to download and timestamp a file), also the timestamp of the target and creates a token from this data.
  • if the token zmd passed to the helper is the same as the calculated one by the helper from source and target timestamps, the helper exits immediately. The first time it will always do the task because the token given by zmd.
  • The helper returns the last calculated token, and zmds uses it to call the binary next time.

This approach allows a prototype updates notifier to check for updates and use very low resources and time for the first time, and almost nothing until something is really changed.

  • note*: for a test implementation, the token used was the sha1sum of the concatenation of sources alias, urls, timestamps plus the same target information.

Main issue

ZMD is volatile. It kills it self and frees the sqlite database (?) leaving a light daemon up. This prevents mono to grow memory consumption because Mono has a flaw where it never returns collected memory to the operating system. This flaw will be fixed in the future ( http://tirania.org/blog//texts/mono-status.html#gc )

When someone connects the light daemon, it starts ZMD again, but as it forgot its state, it must populate the database again. To populate the database, it uses helpers, which are binaries that are run for specific tasks, so they also dont have memory of what happened on the last invocation of the same binary.

Can ZMD remember anything while going to sleep?

Update

Reportedly ZMD does not empty the sqlite database on every sleep but uses it as a cache to speedup wakeup.


Last edit in Trac '06/13/06 11:28:04' by 'kkaempf'


Last edit in Trac '06/13/06 11:28:04' by 'kkaempf'


Last edit in Trac '06/13/06 11:28:04' by 'kkaempf'


Last edit in Trac '06/13/06 11:28:04' by 'kkaempf'


Last edit in Trac '06/13/06 11:28:04' by 'kkaempf'