Load balancing and proxy for Riak-CS

From the basho.com official website – on their technical documentation – we are recommended to place Riak CS behind a load-balancing or proxy solution. Riak CS should not directly expose to public-facing network interfaces.

Today I have managed to make HAPROXY work together with Riak CS as my load-balancing and proxy.

For detail documentation please refer to this link:


You can use my configuration as a reference too.

Please do not forget to edit your /etc/haproxy/gip.lst by inserting your allowed IPs

log local0
log local1 notice
maxconn 256000
spread-checks 5

log global
option dontlognull
option redispatch
option allbackups
no option httpclose
retries 3
maxconn 256000
timeout connect 5000
timeout client 5000
timeout server 5000

frontend riak_cs
# Example bind for SSL termination
# bind ssl crt /opt/local/haproxy/etc/data.pem
mode http
option httplog
capture request header Host len 64
acl good_ips src -f /etc/haproxy/gip.lst
block if !good_ips
use_backend riak_cs_backend if good_ips

backend riak_cs_backend
mode http
balance roundrobin
# Ping Riak CS to determine health
option httpchk GET /riak-cs/ping
timeout connect 60s
timeout http-request 60s
server riak-cs weight 1 maxconn 1024 check
server riak2 r1s02.example.com:8081 weight 1 maxconn 1024 check
server riak3 r1s03.example.com:8081 weight 1 maxconn 1024 check
server riak4 r1s04.example.com:8081 weight 1 maxconn 1024 check
server riak5 r1s05.example.com:8081 weight 1 maxconn 1024 check


Open source PACS & DICOM from DCM4CHE

Screen shot 2013-04-24 at 10.12.28 AM

Last 2 weeks I have configured and played with dmc4che. Its a collection of open source application and utilities for the health care enterprise, PACS and DICOM has been used by hospital in Malaysia from government and pubic sector, 80% of them using PACS/DICOM standard. Its has been developed in Java language to achieve performance and portability, supporting deployment on JDK 1.4 and up. 

With integration few components I managed to run it at local server. 


In order to complete the test I have downloaded DICOM sample image from http://www.osirix-viewer.com/datasets/

You need to use dmcsnd, example;
./dcmsnd CDRECORD@ /home/senn/Downloads/GOUDURIX/GOUDURIX/ -L DCMSND:10104

Once you insert the sample image you can start to browse patient ID and so on.

Screen shot 2013-04-24 at 11.24.49 AM

Once you have all these, you can start to play with DICOM and PACS.

To search the PACS we use the DICOM command C-FIND. This command takes as an argument a DICOM object that represent a query. The PACS transforms the object that we send to a query, probably to SQL, runs it and then transform every result record back into a DICOM object and send it back to us in a C-FIND response. The PACS sends one C-FIND response for every result record.

To learn more, I found this very straightforward website to teach DICOM and PACS.