SRE Flashcards

1
Q

What is difference between process and thread?

A

A thread is a lightweight process. Each process has a separate stack, text, data and heap. Threads have their own stack, but share text, data and heap with the process. Text is the actual program itself, data is the input to the program and heap is the memory which stores files, locks, sockets

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a zombie process

A

A zombie process is a one which has completed execution, however it’s entry is still in the process table to allow the parent to read the child’s exit status. The reason the process is a zombie is because it is “dead” but not yet “reaped” by it’s parent. Parent processes normally issue the wait system call to read the child’s exit status whereupon the zombie is removed. The kill command does not work on zombie process. When a child dies the parent receives a SIGCHLD signal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you end up with zombie processes?

A

Zombie processes are created when the parent does not reap the child. This can happen due to parent not executing the wait() system call after forking.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Describe ways of process inter-communication

A
POSIX mmap, 
message queues, 
semaphores
Shared memory
Anonymous (unnamed) pipes and named pipes
Unix domain sockets
signals
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Describe how processes executes in a Unix shell

A

Let’s take the example of /bin/ls. When run ‘ls’ the shell searches in it’s path for an executable named ‘ls, when it finds it, the shell will forks off a copy of itself using the fork system call. If the fork succeeds, then in the child process the shell will run ‘exec /bin/ls’ which will replace the copy of the child shell with itself. Any parameters that that are passed to ‘ls’ are done so by exec.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are unix signals?

A

Signals are an inter process communication method. The default signal in Linux is SIG-TERM. SIG-KILL cannot be ignored and causes an application to be forcefully killed. Use the ‘kill’ command to send signals to a process. Another popular signal is the ‘HUP’ signal which is used to ‘reset’ or ‘hang up’ applications

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

When you send a HUP signal to a process, you notice that it has no impact, what could have happened?

A

During critical section execution, some processes can setup signal blocking. The system call to mask signals is ‘sigprocmask’. When the kernel raises a blocked signal, it is not delivered. Such signals are called pending. When a pending signal is unblocked, the kernel passes it off to the process to handle. It is possible that the process was masking SIGHUP

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

MyISAM vs InnoDB storage engines

A
  • MyISAM will out-perform InnoDB on large tables that require vastly more read activity versus write activity.
  • MyISAM’s readabilities outshine InnoDB because locking the entire table is quicker than figuring out which rows are locked in the table. The more information in the table, the more time it takes InnoDB to figure out which ones are not accessible.
  • If your application relies on huge tables that do not change data frequently, then MyISAM will out-perform InnoDB.
  • Conversely, InnoDB outperforms MyISAM when data within the table changes frequently. Table changes write data more than reading data per second. In these situations, InnoDB can keep up with large amounts of requests easier than locking the entire table for each one.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Describe a situation in which you had to solve a critical issue

A

Hardware testing thermal issues on a new server platform

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is race condition

A

2 or more operations try to execute at the same time, but should be performed in a specific sequence. (use stress/load testing)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do you debug a core

A

Use a tool like gdb
GDB, the GNU Project debugger, allows you to see what is going on `inside’ another program while it executes – or what another program was doing at the moment it crashed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly