En cours

Small Python Application

Python version: 2.7

Python modules: multiprocessing, argparse, time, datetime, sys, os

** if possible, [ import multiprocessing as mp ]

External Python modules:

Pika ([url removed, login to view])

Pika documentation ([url removed, login to view])

Psycopg2 ([url removed, login to view])

Server OS: Fedora 14

For the sake of the specification we'll call the app "vnetserver"

The app should be controlled by an "init" run script called "vnetctrl"

service vnetctrl {start|stop|restart|status}

....status: display main parent and any running children

"vnetctrl" starts "vnetserver"

vnetserver is called with a single command line option "-f" which points to the config file

example: vnetserver -f /etc/vnet/[url removed, login to view]

The config file contains the following:

rabbitserver: [url removed, login to view]

pgdsn: host=[url removed, login to view] dbname=mydbname user=mydnuser

App starts and creates a pool of workers, 2x workers per cpu

no. of cpus determined with multiprocessing.cpu_count() .... [ mp.cpu_count() ]

App reads a message from the queue and passes it to a worker

worker connects to postgres and inserts the message

if the insert is successful, worker then acknowledges consumption (channel.basic_ack...)

worker returns to the pool

Additional thoughts:

Is it possible to dynamically adjust the "worker pool size" based on system load?

At this stage the message format is a simple test message which is the "epoch. milliseconds"

Python Pika comes with various examples

The objective is to test that Python will run on all cpus when given a heavy load.

Compétences : Python

Voir plus : pika python multiprocessing, python pika example, service channel, server load test, postgres service, pool host, objective examples, message queue server, app script examples, application examples, pika python, python pika, small server, python download file, download file python, sys, sake, python c, python application, postgres, mp, message queue, fedora, application test, application children

Concernant l'employeur :
( 5 commentaires ) Surrey, United Kingdom

N° du projet : #1013053

1 freelance a fait une offre moyenne de 100 $ pour ce travail

raczman

Hello, i have experience in implementing python apps that use rabbitmq via pika. I can start immediately.

100 $ USD en 3 jours
(0 Commentaires)
0.0