Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

feat: add multiprocess event serialization #82

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rkokkelk
Copy link
Contributor

Events were previously serialized serially. However by using Python
concurrent features it is possible to execute event serialization over
multiple cores greatly decreasing overall execution time.

The actual sending of the serialized event is done without
parallelization due to threading lock issues in the Python Redis
implementation.

Relies on PR: #80

This implementation decreased running time for parsing 20k records in 120s to 20s on a quad core laptop.

When `Event` is init, it automatically loads the harmonization config
file. This means that for every event uploaded, the entire harmonization
config file is loaded and parsed. This dramatically extends the time
needed to parse a single event.

This PR ensures that the harmonization file is only loaded once and then
used for generating all `Event` objects.

Fixes: certat#79
Ensure that harmonization config file is loaded from file directly,
instead of `Event` object.
Events were previously serialized serialy. However by using Python
concurrent features it is possible to execute event serialization over
multiple cores greatly decreasing overall execution time.

The actual sending of the serialized event is done without
parallelization due to threading lock issues in the Python Redis
implementation.

Relies on PR: certat#80
@rkokkelk
Copy link
Contributor Author

Worked in development, however when implemented in production environment (RH7, Apache, WSGI), the created processes used by concurrent.futures, were killed. So probably something in the WSGI config was not configured correctly for using it in this kind of implementation. Further testing should be done on other platforms to determine if the issue originates from the code base or implementation configuration. If it depends on the implementation, additional documentation should be made.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant