Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  How does GoLang know how many CPUs to use?

When running lscpu command on Linux, it will list the CPU info on the machine. Take one example where there is one CPU with 2 cores and each core has two threads which indicates there are 4 cores available.Now let's see how many cores GoLang program would identify.From output, NumCPU and GOMAXPROCS both output 4 which is expected. How does go runtime get this info, does it get it through similar command like lscpu or /proc/cpuinfo? Let's dig more in GoLang's source code.In runtime/debug.go, it tells that this value is from the global variable ncpu which is set when process starts and...

6,789 0       CPU GOLANG NCPU


  Server monitoring shell scripts

There are many open source server monitoring software such as cacti and nagios. Besides these, can we write our own shell scripts to monitor them? The shell scripts written by ourselves can fulfill our special requirements better and have a more detailed coverage.Below are some commonly used shell scripts used by Evangelist, an Oracle DBA. 1. Check network gateway traffic#!/bin/bash#network#Mike.Xuwhile : ; do time='date +%m"-"%d" "%k":"%M' day='date +%m"-"%d' rx_before='ifconfig eth0|sed -n "8"p|awk '{print $2}'|cut -c7-' tx_before='ifconfig eth0|sed -n "8"p|awk '{print $6...

46,011 2       MEMORY SHELL CPU SERVER MONITOR


  Simple explanation about process and thread

Process and thread are two basic concepts of operating system, but they are a bit abstract which cannot be  mastered easily.There is an analogy which explains these concepts very well.1. The kernel of the computer is CPU, it handles all the computing tasks, it's like a factory and will run all the time.2. Assume there is power limitation for the factory, it can only supply to one unit once,i.e, when one unit is working, other units must stop and wait. The meaning behind this is that each CPU can handle only one task at once.3. Process likes the unit in the factory, it represents the singl...

11,727 0       PROCESS OPERATING SYSTEM CPU THREAD


  A Solution to CPU-intensive Tasks in IO Loops

Back in October 2011, Ted Dziuba infamously said that Node.js is Cancer.  A provocative title to a provocative article.  The only thing it didn’t really provoke in the commentary was much thought ;)  Zing.My interpretation of the article is that Ted holds up the classic blocking-IO process-per-request (or  thread per request; same difference) model as superior.  Yet we all remember where the blocking-IO forking model got Apache in the early days.  So I’m a tad uncomfortable with his solution from the good old days.  But fundamentally you ca...

3,446 0       C++ SOLUTION CPU INTENSIVE IO LOOPS