I am doing large DB imports on a Postgres instance running in a Proxmox 1.9 OpenVZ virtualized Ubuntu 11.04. For some reason, the executable that initiates and controls the import (or Postgres), always stops at some point, typically, when there is high I/O load on the system (i.e. the proxmox host or in any of the VM instances) caused in addition to that of the importing process. I am trying to figure out the root issue and whether I can potentially avoid it. Ps tells me that wchan = n_tty_ for the importing process (which is sleeping). First of all what does this mean and what are good practices in how to debug further?

link|improve this question
feedback

1 Answer

Try strace.

You can invoke it like strace -p pid

Or, better yet, *strace your_prog_here*

link|improve this answer
strace -f -v -p 27662 Process 27662 attached - interrupt to quit read(0, Process 27662 attached - interrupt to quit read(0, ^C <unfinished ...> Process 27662 detached' Hm, I am not any wiser now.. – user462982 Jan 20 at 0:26
1  
file descriptor 0 is stdin, it sounds like this process is reading something from it's terminal or a pipe, and it is waiting for that. Are you sure you are running the command properly (passing input to it on stdin when necessary)? Is there a command in a pipe in front of this that maybe is hanging and not sending data to this process? – Sean Reifschneider Jan 20 at 4:37
The program is a c program compiled on the same system and it talks to postgres via pipe, so this could be the issue here I guess (it does not require user intervention). Postgres indicates the program still as connected, though idle for more than 24hs. To me, this looks like a problem with IPC. As I have the source of the c program (I am not not a c developer, though), is it maybe possible (and would it help) to include some kind of debug symbols/compile it with debug flags (without changing the source and with gcc) that could provide more information? – user462982 Jan 20 at 8:10
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.