Friday, July 13, 2018

Idea for patent

Return machine Id
 and use this for routing future requests . This will give cache locality.

The ui/ mobile app should use this I'd for all future requests.

Wednesday, July 11, 2018

Where containers would have helped me.

We had a system with tomcat which would respond to user requests for data.
This application was also responsible for going to couple of data sources and fetching data and then parsing it . During the time the application was parsing the data the web application would become unresponsive. Even if we launched a separate java process it would take up the memory for the web-application and also there is no way to limit cpu usage ( I am aware of cpu groups ).
In this case we could have used containers.

Tuesday, May 29, 2018

Optimizations I did

1) Made calls Async from Sync which brought down time from 118 msec to 38 msec per call.
2) Increased the number of threads for Kafka ( also increasing the partitions). Existing system was not creating enough threads and as the work performed was IO bound there should have been more threads.
3) StackOverflow exceptions and Out of Memory errors in toString fixed with rope and Charsequence.
4) Elasticsearch enabled the snitch at driver level for equitable distribution of load.
5) Used Hashmap instead of ArrayList for contains in operation.

Friday, April 13, 2018

Setting the limits in Linux permanently

app soft nofile 16384
* hard memlock unlimited
elasticsearch hard memlock unlimited

root soft memlock unlimited
root hard memlock unlimited
#RLIMIT_MEMLOCK, soft limit: 65536, hard limit: 65536
elasticsearch soft RLIMIT_MEMLOCK 65536
elasticsearch hard RLIMIT_MEMLOCK 65536

 /etc/security/limits.conf I have set:
elasticsearch - nofile 65535
elasticsearch - memlock unlimited
root - memlock unlimited
elasticsearch soft memlock unlimited
elasticsearch hard memlock unlimited
docker - nofile 65535
docker - memlock unlimited
docker soft memlock unlimited
docker hard memlock unlimited
user hard memlock unlimited
user soft memlock unlimited
user - memlock unlimited

Monday, April 9, 2018

Difference between notify and notifyAll

package com.csco;

class ChildThread implements Runnable{
    private Object object;
    private String threadname;

    public ChildThread(Object object, String threadname) {
        this.object = object;
        this.threadname = threadname;

    public void run(){
        synchronized (object){
            try {
                System.out.println("This thread "+ threadname +" going to wait "+System.nanoTime());
                System.out.println("This thread "+ threadname +" notified "+System.nanoTime());
              //  object.notifyAll();            } catch (InterruptedException e) {



public class MainThread {
    public static void main(String[] args) {
        Object obj = new Object();
        ChildThread th1 = new ChildThread(obj,"thread1");
        ChildThread th2 = new ChildThread(obj,"thread2");
        ChildThread th3 = new ChildThread(obj,"thread3");
        ChildThread th4 = new ChildThread(obj,"thread4");
        ChildThread th5 = new ChildThread(obj,"thread5");

        new Thread(th1).start();
        new Thread(th2).start();
        new Thread(th3).start();
        new Thread(th4).start();
        new Thread(th5).start();

        try {
            synchronized (obj) {
                obj.notify(); // Change this to notifyAll to see the difference                
        } catch (InterruptedException e) {

Friday, March 23, 2018

Really Advance Java

Monday, March 12, 2018

Idea for patent

Return machine Id  and use this for routing future requests . This will give cache locality. The ui/ mobile app should use this I'd f...