Đang Thực Hiện

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.

Kỹ năng: Python

Xem thêm: 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

Về Bên Thuê:
( 5 nhận xét ) Surrey, United Kingdom

Mã Dự Án: #1013053

1 freelancer đang chào giá trung bình $100 cho công việc này


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

$100 USD trong 3 ngày
(0 Đánh Giá)