Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Wednesday, August 13, 2014

C++ GExecutor 1.1 version is released!

Asynchronous and Synchronous together!

https://github.com/cppexecutor/gexecutor

Finally completed framework that solves pressing problems in many high transactions applications in real world scenarios.

I love asynchronous architectures and applications. But, every now and then there is a requirement to make synchronous API calls like third party API, or do a database call for configuration information that is synchronous. 

GExecutor provides a unified way to handle synchronous and asynchronous tasks by abstracting them from underlying thread and process architecture. It is a C++ library which offers similar capabilities like Executor framework in Java and Twisted in Python.

One of the well studied patterns for implementing a High performance I/O bound applications is to use asynchronous processing of client requests. Multiple client requests can be served without the cost of context switching thus achieving better performance at lower CPU and memory requirements. Such a design pattern is also referred as reactor pattern. Libraries like libevent or boost::asio make it easy to implement reactor patterns built on lower level APIs like kqueue, epoll, select etc.

Multi-threaded or multi-process performance can outperform a single threaded systems by using concurrent data structures or shared memory in spite of added context switches and locking overheads in a reactor pattern. However, such systems may not perform well due to bad locking design (coarse), deadlocks, and complex data structures based on shared memory. More details on this discussion can be found at C10K Problem.

GExecutor offers a hybrid solution to take advantage of both paradigms and make it simple to use appropriate pattern for different aspects of application without loss of performance. It is a hybrid event loop based task processing framework which handles and routes tasks between async event loops and worker threads for processing synchronous tasks. It is designed as a utility that can be layered on top of libevent or asio.

Existing applications can continue to use their current bindings to native interfaces and just use GExecutor for deferred task processing.

cheers!









Saturday, May 25, 2013

Helpful Ubuntu and Linux Admin Utilities

SSH with no password


Simple Steps
1. On Client (Mac or Linux): create keys
mkdir ~/.ssh
chmod 700 ~/.ssh
ssh-keygen -t rsa
2. Copy only Public Key to the Server or remote host

ssh-copy-id <username>@<host>
If ssh-copy-id not found then do this on the server
cp authorized_keys authorized_keys_Backup
cat id_rsa.pub >> authorized_keys

Software

sudo apt-get install openssh-server
sudo apt-get install openssh-client

Copy files from one machine or folder to another


sudo rsync -azvv /home/path/folder1/ /home/path/folder2

Software

sudo apt-get install rsync