docker-logo
September 21, 2016

My love affair with Docker

Last few days has been the worst for our business and part of it is to do with a much-hated hosting provider – OVH. Some devs like it, and some don’t! If you read the reviews about this hosting, you’d probably find a lot of bad things said about them and their network than good ones. The only reason we prefer OVH over AWS (which we do use for most of our production apps) is to do a lot with their no questions asked policy for IPv4 addresses.

I am sure most of you know we have a shortage of IPv4 addresses. It’s been in the news, and nearly 80% of the people who heard the news probably had absolutely no clue about what was going on in the computer world. Anyway, I won’t go into explaining that for the newbies to this comp world. That would deviate me from what I want to talk about in this post. Hopefully, this will act as a guide to those who are facing similar issues as us. There is another good reason we go with OVH. They are damn cheap. Two of the basic dedicated public cloud instances cost us $50 or so to run every month. I am pretty sure Amazon can’t beat that on a month-to-month contract. They probably can beat that on a three-year lease but not a monthly contract.

Anyway, my love affair with Docker started with issues developing on our traditional OVH dedicated instance. We had all kinds of troubles. The containers we were running were close to 160 on a 32GB v2 configuration – Ubuntu 14.04 LTS. This is not too bad given that Docker shares memory across all the containers. As soon as I configured more than 160 containers, all hell broke loose. We received a whole lot of errors and the IPs that were configured stopped working. This was probably the most frustrating moment of the whole experience because there are no real guidelines on optimising memory usage for Docker. You just got to have more memory if you want to have lots of containers. Here are a couple of things to help you run a lot of

Anyway, Here are a couple of things to help you run a lot more smoothly and hopefully resolve a lot of those errors. They are in no particular order. We pretty much tried all of them out, and they work flawlessly on the virtual instances we were running. Now, I am not sure what your purpose for running Docker containers is so. So please use these commands with caution. If you are taking a step back from executing these, I’d say consult your developer or someone who knows what they are doing (Docker Expert).

1) Stop all Docker Containers

docker stop $(docker ps -a -q)

2) Remove all Docker Containers

docker rm $(docker ps -a -q)

3) Remove any volumes that are unused.

docker volume rm $(docker volume ls -qf dangling=true)

4) Remove problematic networks

docker network rm(docker network ls -q)

5) Find out if any of the processes are still occupying a port

lsof -nP | grep LISTEN

Then you’d get an output similar to this…

Dropbox             384  IPv4 0x82c      TCP 127.0.0.1:17600 (LISTEN)
com.docker.slirp   6218  IPv4 0x82c      TCP *:5432 (LISTEN) <<<MOSTLY THE PROBLEM
Python             6268  IPv4 0x82c      TCP 127.0.0.1:51617 (LISTEN)

Now, just kill it…

kill -9 6218

6) Find “docker.service” file and see it to this (Helps with starting up lots of containers)

TasksMax=infinity

7) One of the Docker Limitations includes running out of keys and all kinds of stuff. Use these commands to overcome those issues (Adjust the numbers as you see fit)

echo 4194304 > /proc/sys/kernel/pid_max
echo "20000000" > /proc/sys/kernel/keys/root_maxbytes
echo "20000000" > /proc/sys/kernel/keys/maxbytes
echo "1000000" > /proc/sys/kernel/keys/root_maxkeys
echo "1000000" > /proc/sys/kernel/keys/maxkeys

8) Docker Clean Up (because it does get dirty and its not good at cleaning itself)

docker ps --filter status=dead --filter status=exited -aq \
  | xargs docker rm -v

9) Another Docker Command to Clean things (Helps with high disk space usage)

apt-get autoclean
apt-get autoremove

 

Some other things that help would be cleaning up unused images. You can find command for it online. Ask your best friend Google. Always remember, measure the amount of RAM you would need by the footprint of your container. If your container has a footprint of 1MB, 10k containers would cost you 10GB memory. Compare that with having 100MB footprint; you would need 1TB memory. That’s a lot. If you are looking into starting up quite a lot of containers, this article is quite good (Docker insane scale on IBM Power Systems). It talks about the limitations of Docker when you want to start up lots of containers. We found this guide quite helpful.

I am in love with Docker. I have to say…it was love at first sight. It’s so Awesome! It’s useful for a lot of things, but I don’t know how much longer we’ll stay together because technology is emerging at a very fast pace. Let’s hope Docker advances in which case; it’ll be until death do us part. If not, then…yeah. I’d rather not talk about that. Here

Here are a couple of things I currently love about Docker. Docker has everything in containers and I love containers. Since 2013, the eco-system has contributed nearly 100,000 public images on Docker Hub. Love…love…love.

#1 Docker has everything in containers and I love containers. Since 2013, the eco-system has contributed nearly 100,000 public images on Docker Hub. Love, love, love.

#2 Developers love Docker and Docker loves them back. Docker provides full life cycle control and that’s important for any system architecture. It works flawlessly on practically anything. So when you wake up at 2AM in the morning for troubleshooting, you know you can switch on your laptop, run the image, and start troubleshooting the script that went bad. There are lots of other reasons why developers dig this.

#3 I have hired and spoken to lots of system developers and they love Docker. I ask them to install or configure anything, they love hitting up the Docker Hub and look for images they could use. Why? It saves them time and more so, a lot of headache with incompatibilities. So when newer technologies emerge, you can easily try them on and put them into production without having to worry about where it works and where it does. You don’t even need to worry about breaking links or dependencies.

Good Luck!

September 16, 2016

Love them while they’re still around…

A lot of times, we get carried away with our responsibilities and tasks. We give little thought towards our loved ones. The people who genuinely care about us. I am guilty of that. In earlier years of my life, when I was just starting to expand my businesses, I gave a little time to those who loved me – my family and friends. Most of them stuck around. They continued to show how much I meant to them. Sadly, some people in my life loved me greatly, but I couldn’t return that love. They are no longer there, and I sincerely regret that. When these events took place, it didn’t bring in much of a change in me. I was grieving, but that’s about it.

Almost every Friday just before the sunset, while I watch the waves crash on the shore, in my favourite spot, I end up pondering on things in life. Quite recently, while in the process of doing that, I started to realise how short our lives on this earth is. I was imagining myself getting old, feeling unwanted, and left in a rest home. Now that’s a very long way away but something to consider. I would be no longer considered ‘useful’ at that age. I certainly don’t want to feel abandoned. I would love to hear from people I love. I would like to see them check up on me and see how I am doing, showing that they still care. It would be awesome if they would make me feel wanted. So I decided to do what I would have wanted for myself. So every Friday, I made a promise to myself, to call my grandparents and check up on them.

I am often quite busy with a lot of business issues to deal with, but I stuck to this promise. Today, after making a phone call, I heard my Nana tell me how much this call meant to her. Right after she enquired about how we all were doing as a family, I asked her, how she was feeling? She was in tears, and it brought tears to my eyes. She said, none of my sons checked up on me since months. She told me how lonely she felt, and she was very appreciative of my call. We often forget, but a lot of people you love would not stay in this world forever. They are bound to be called home, and we never know when that’ll happen. Take a moment from your busy life. Make it a priority to stay in touch with those who love you. Even a minute of your phone call might mean the world to them. Think of the joy it brings to others.

Love is not always a two-way thing. I’ve realised that quite recently. So don’t be discouraged, love those who love you and also those who don’t. I am not talking about passionate love but rather selfless love (Agape). God loved you even before you had a chance to love Him. He loves those who still don’t even know Him or What He did for them. We lack a lot of Love in his world. Show people around you some love today and let that draw them nearer to God.

“Love suffers long and is kind; love does not envy; love does not parade itself, is not puffed up; does not behave rudely, does not seek its own, is not provoked, thinks no evil; does not rejoice in iniquity, but rejoices in the truth; bears all things, believes all things, hopes all things, endures all things. Love never fails” (1 Corinthians 13)

Productivity Tab Use
September 8, 2016

Tabs don’t do you any good!

Tabs really don’t do you any good. I am not referring to betting tabs but browser tabs for productivity. Although, thinking about it now, both of them don’t do you any good. Recently, I ended up closing nearly 70 tabs I had for well over a month now. Till a couple of days back, I was a strong believer of Multi-Tasking. I’ve read articles where they talked about people multi-tasking to get a whole lot of work done. Then, I had time to sit down and think about things. I realised, our minds are not capable of multi-tasking although devices now support that. I know iPad has a multitasking feature which allows you to watch a video while jotting down some notes on the side.

While this is great for note taking, it probably isn’t so good when trying to complete a lot of things on time. You see, our minds are capable of splitting attention only one way. I don’t think we are wired to think two thought lines at the same time. You can concentrate and give your attention only to one thing at a time. While our brains are capable of switching tasks in milliseconds which make it look like we’re multitasking. Productivity, I believe, doesn’t have an impact from this. I had those browser tabs for a very long period. I realised that each day, my browser continues to keep them open, and I continue to think I will get to it sooner or later.

Then, on a very fine day, I went on a rampage. I decided to quit or close all the browser tabs and start a text document. In that text document, I noted down what the task was and pasted the links below those tasks. Now, I just go through each task, prioritise them, and start finishing those tasks. Once I am done, I just delete those tasks off from that text document. It’s a funny story because although we have a really good project management software we use at our company, I barely get to using it effectively (especially jotting down some quick tasks like sending an email to a specific person). I feel like it would probably waste my time even more if I note it down as a task because it only takes a few seconds to carry it out.

Hopefully, this will come in handy to those who are still going by that false belief that makes you think you will achieve a lot by multi-tasking. Start with a task and complete it. Don’t start on new tasks until you’ve got the task you’re on finished.

[Image Source: https://cdn2.hubspot.net/hub/271673/file-2535649831-jpg/blog/iStock_000013749421Medium.jpg]

header_Silence
August 31, 2016

Ouch…that hurts!

A lot times in life people get rejected for all kinds of things. Quite recently (I mean today), I was rejected on something that I believed was true. Till this time in my life, I never tasted what rejection felt like. And it’s bitter…very bitter. You hear people talking about it; So you try to console them or make them understand there are greater things yet to come. But I don’t think you can really understand the true pain that someone goes through until you experience it yourself. As part of this life, we are bound to face rejection. For me, it came at quite a later stage in life. So I came home feeling sad, disappointed and obviously rejected.

In my life, success came in bountiful purely by having God by my side. I found it easier to work hard and earn my way through different stages. By God’s grace, I’ve done quite well in life. I am proud of His work in my life. I have been blessed with a lot of things that others only dream about. I’ve rejected a lot of things that came to me including the very experience I went through where I was on the other side. But tables have turned. I didn’t realise how much it would affect someone who has been rejected. But today I know and I am glad, I know.

It gave me a good perspective to see what Jesus must have felt like. What I feel like is nothing compared to what Jesus must have felt like. In fact, I rather not even compare my experience with His. His rejection is far greater than what our minds can comprehend with. It says in Matthew 27:46, “About three in the afternoon Jesus cried out in a loud voice, “Eli, Eli, lema sabachthani?” (which means “My God, my God, why have you forsaken me?”).”. Here is the son of God (who we know is one with Father) crying aloud asking God why he had been forsaken. What a distasteful feeling it must have been to feel rejected? It would have been millions of folds greater than what I experienced today.

So now, I appreciate a little more of what Jesus did for you and me. What he went through so we can have life and life more abundant. Thank God for giving me this experience. Now I know rejection feels like. I would be so much more sensitive to people who have been rejected now. More so than that, I would be that much more grateful each time I pray about the cross. Thank you Lord for the cross!

How deep the pain of searing loss
The Father turns His face away

Image Source: [https://alpha.aeon.co/images/d2ade413-3c90-4fc6-82f1-2d39624aa318/header_Silence.jpg]

Older Posts