I notice some process always have VSZ as 0 how to understand why they have 0 VSZ? Answer VSZ is the Virtual Memory Size. It includes all memory that the process can access, including memory that is swapped out, memory that is allocated, but not used, and memory that is from shared libraries. So, the top comma…
Tag: linux
meaning of EPOLLERR from epoll_wait with a pipe
This is similar to the question 1 but is about pipes. If epoll_wait returns EPOLLERR for the write end of a pipe, how do I distinguish a general error condition from the read end of the pipe been closed? For the sockets case the answer was to use “use getsockopt and SO_ERROR to get the pending errorR…
Reactive Extension .NetCore Observing on MainThread
I’m trying to do a lot of network operation in parallel, and I want to set a timeout to each operation. Since Parallel.ForEach doesn’t have an easy timeout option, I’m using System.Reactive. this is my code: I’m using the Observable.Amb operator to run in parallel a 60 seconds timer, t…
How do I find a system memory leak in linux?
I’ve got a monolithic piece of software, a game on a basic linux kernel, that seems to leak memory in swap space. The memory usage of the process itself is reported as constant over a day or so but the free memory on the system is consistently decreasing until there is no more physical ram space. There …
Kafka – Broker: Group coordinator not available
I have the following structure: Created topic with replication factor 3 and partitions 3 by kafka-topics shell script. And use group localConsumers. it works fine when leader is ok. Consumers’ log But if leader is down – I get the error in consumer (systemctl stop kafka): Node 3 is unavailable. ok…
getuid/geteuid strange behaviour
I’ve got a simple code, which basically looks like: Which basically outputs the real and effective user id. Now, once build with: go build main.go; I also call sudo chown root:root main && sudo chmod 4755 main to get -rwsr-xr-x permissions on the file. If I understand the concept of the setuid b…
How to replace ‘-u username -p password’ with new value in linux shell?
old value: 10.125.11.5:27017 -u username -p password new value: 10.125.19.6:27017 I want to replace all the old value in *.py files (current directory folder and subdirectory) using shell,how to do? seems sed or grep can not work with’-u’ or ‘-p’. Answer Suppose you have an inputfile w…
Do we need to unlocking a mutex after recived a signal from cond variable?
I making an app in C for educational purposes with mutexes and conditional variables. Short example here: Can you explain me, why after “while” statment (and recived signal from second thread) we need to unlock the mutex, when signal makes that mutex is locked? I get it from a lot examples from we…
Using Sendmail from an external server
I have a server with a webapp and a mail server (who use sendmail to route mails). We need to migrate the webapp to an auto-scaling schema, so, I can’t have the mail server in there, so, I’m thinking on leaving the mail server right where it is now. So, to send mails I have different alternatives,…
Azure CosmosDB on Linux
is there a way I can run a CosmosDB emulator on a Linux machine? I need to setup a development environment for Azure Functions projects. There is a solution for storage (Azurite), I wonder I can find the same for CosmosDB. (Running a virtual machine is not an option for this case) Answer The short answer: Tod…