Questions tagged [socket]
A socket is an abstract network construct with a sending and receiving side. In most modern operating systems (OS) there are device representations, and programming tools to address sockets.
572
questions
234
votes
3
answers
242k
views
What is the difference between Unix sockets and TCP/IP sockets?
It's from this answer:
https://stackoverflow.com/questions/2482411/is-this-pdo-bug-fixed-now/2482424#2482424
When the host is "localhost", MySQL Unix clients use a Unix socket, AKA Unix ...
132
votes
8
answers
321k
views
How to forcibly close a socket in TIME_WAIT?
I run a particular program on linux which sometimes crashes. If you open it quickly after that, it listens on socket 49201 instead of 49200 as it did the first time. netstat reveals that 49200 is in ...
71
votes
7
answers
140k
views
How to force MySQL to connect by TCP instead of a Unix socket?
I would like to analyze mysql traffic. Right now, all mysql requests are sent to the MySQL unix socket:
unix 2 [ ACC ] STREAM LISTENING 3734388 15304/mysqld /var/run/mysqld/...
56
votes
5
answers
98k
views
Create Unix Named Socket from the Command Line
Is there a command similar to mkfifo but for domain sockets?
54
votes
3
answers
31k
views
Unix socket vs TCP/IP host:port
Could someone please describe to me the pros and cons of using a Unix socket file vs a tcp/ip localhost:port when setting up services on a server (Ubuntu, FWIW)?
In this particular instance it's for ...
48
votes
7
answers
84k
views
How to find other end of unix socket connection?
I have a process (dbus-daemon) which has many open connection over UNIX sockets. One of these connections is fd #36:
=$ ps uw -p 23284
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME ...
46
votes
4
answers
120k
views
How to automatically restart a service on failure in Linux
On Windows, you can set what should happen if/when a service fails. Is there a standard way of achieving the same thing on Linux (CentOS in particular)?
A bigger part of my question is: how do you ...
45
votes
7
answers
55k
views
Forward local port or socket file to remote socket file
Quick question - I run two linux boxes, one my own desktop and the other my VPS. For security reasons on the VPS end I opted for socket connections to MySQL (/var/run/mysqld/mysql.sock). I know I can ...
31
votes
5
answers
37k
views
Need to increase nginx throughput to an upstream unix socket -- linux kernel tuning?
I am running an nginx server that acts as a proxy to an upstream unix socket, like this:
upstream app_server {
server unix:/tmp/app.sock fail_timeout=0;
}
server {
listen ###.###.###....
27
votes
6
answers
110k
views
Network Error: no buffer space available
After some time of running fine, one of our Windows XP SP3 machines does not open some(!) new TCP/IP connections anymore.
Putty says Network Error: no buffer space available, IE won't open any new ...
25
votes
7
answers
123k
views
What should mysqld.sock contain, why don't I have it?
Does anyone know why my /var/run/mysqld/mysqld.sock socket file would not be on my computer when I install (or reinstall) MySQL 5.1?
Right now, when I try to start up a server with mysqld, I get ...
25
votes
2
answers
18k
views
When to use a MySQL socket and when to use a host:port?
Many applications allow me to connect to Mysql using a username, password host and port. Some allow me to configure a socket instead of the host:port.
Is there any clear benefit of one over the other?...
24
votes
5
answers
219k
views
How to get a linux network log?
We have a java server running in linux at a specific port that accepts persistent connections for thousands and thousands of users. Recently our clients are not able to connect with a time out error. ...
22
votes
3
answers
30k
views
Sockets found by lsof but not by netstat
I have an application which is running out of file descriptors, apparently by opening sockets, but I can't find out exactly what these sockets do. These appear in the lsof output as
java 9689 ...
21
votes
4
answers
40k
views
How do I configure Nginx proxy_pass Node.js HTTP server via UNIX socket?
I am trying to configure a Nginx server to connect to a Node.js HTTP server via a UNIX domain socket.
The Nginx configuration file:
server {
listen 80;
location / {
proxy_pass http://unix:/...
20
votes
1
answer
26k
views
How to expose a UNIX domain socket directly over TCP
I'd like to have a UNIX domain socket, say /var/program/program.cmd for example, exposed via TCP, lets say on port 12345. I'd also like this to be running full time in the background.
What's the best ...
19
votes
3
answers
15k
views
Sharing unix socket via docker volume - permission denied
I try to share my php5-fpm socket via a volume with my nginx webserver. Fpm and nginx are running in different containers and I want to get them working via a shared volume where I place the socket ...
18
votes
4
answers
68k
views
Max number of socket on Linux
It seems that the server is limited at ~32720 sockets... I have tried every known variable change to raise up this limit. But the server stay limited at 32720 opened socket, even if there is still 4Go ...
17
votes
1
answer
46k
views
Configuring Apache 2.4 mod_proxy_wstunnel for Socket.IO 1.0
I'm trying to configure Apache 2.4 for proxying the websocket connection for socket.io to a node.js websocket server, using mod_proxy_wstunnel. We had this working fine with socket.io 0.9, but with ...
17
votes
7
answers
33k
views
Linux command to wait for a SSH server to be up
I have a script which creates a virtual machine and gives me back an IP address.
Then I would like to do something like this:
waitforssh 192.168.2.38 && ssh 192.168.2.38
And it will wait ...
16
votes
5
answers
33k
views
How to set up memcached to use unix socket?
While I could use memcached on Debian to use the default 11211 port, but I've had great difficulty setting up Unix socket.
From what I've read, I know that I need to create a memcache.socket and add:
...
14
votes
5
answers
32k
views
linux : netstat listening queue length
Is there a way to view queue length on listening socket under Linux, the same way as netstat -L outputs for FreeBSD? I.e. you can see X/Y/Z in netstat -L output, but netstat under Linux doesn't ...
14
votes
4
answers
44k
views
Is it dangerous to change the value of /proc/sys/net/ipv4/tcp_tw_reuse?
We have a couple of production systems that were recently converted into virtual machines.
There is an application of ours that frequently accesses a MySQL database, and for each query it creates a ...
14
votes
7
answers
47k
views
Nginx + php5-fpm = "File not found"
I've hit a wall whilst setting up a site using nginx / fpm. The page displays "File not found", and this appears in the nginx error.log:
FastCGI sent in stderr: "Primary script unknown" while reading ...
13
votes
7
answers
54k
views
Can't connect to MySQL using 'localhost' but using '127.0.0.1' it's ok?
My /etc/hosts file looks like this:
127.0.0.1 localhost
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
...
13
votes
5
answers
16k
views
Does the TCP source port have to be unique per host?
I've learned that a TCP connection is identified by the tuple (source IP, source port, destination ip, destination port). Theoretically, it should thus be possible to have a client from host1:port1 ...
13
votes
1
answer
24k
views
Expose a Unix socket to the host system from inside from a Docker container
I would like to run aweb server inside a Docker container that listens to a Unix socket, instead of to a port. I'm finding a lot of results on sharing the Docker socket, but I don't think that's what ...
12
votes
5
answers
16k
views
Sniff UNIX domain socket
I know that some process is writing to a certain unix domain socket (/var/run/asterisk/asterisk.ctl), but I do not known the pid of the sender. How can I find out who is writing to the socket? I have ...
12
votes
0
answers
673
views
How much does FreeBSD accept_filter actually improve performance in a modern world?
I recently learned about FreeBSD's accept_filter socket option which can allow a worker process to avoid context switching by, for example, waiting until a full HTTP request is received with accf_http:...
11
votes
3
answers
23k
views
What are the ramifications of setting tcp_tw_recycle/reuse to 1?
I set both tcp_tw_recycle/reuse to 1 in my configuration file.
What are the ramifications of doing this?
If a tcp socket is re-used, does that pose a security risk? i.e. 2 different connections both ...
11
votes
2
answers
9k
views
Check if a path exceeds maximum for Unix domain socket
Operating systems limit the length of a path of a Unix domain socket. How can I check whether a particular path is within that limit?
Or, to put it another way, how can I check the maximum permitted ...
11
votes
4
answers
13k
views
Siege: descriptor table full sock.c:119: Too many open files
I am trying to make a stress test in my own server using siege with the following command:
$ siege -c 500 myweb.com/somefile.php
But I get this error:
[error] descriptor table full sock.c:119: Too ...
11
votes
2
answers
45k
views
What does TCP: too many orphaned sockets mean?
When I use dmesg to look at linux kernel messages, I see a flood of....
TCP: too many orphaned sockets
messages. My guess is this is sockets that are hanging around in TIME_WAIT after being closed ...
10
votes
5
answers
91k
views
How to determine number of open sockets? VM Resource Issues
I've got a MediaTemple DV server. I've been seeing a lot of QOS alerts for "numothersock" which is defined as:
The number of sockets other than TCP ones. Local (UNIX-domain) sockets
are used for ...
10
votes
3
answers
39k
views
Running a websocket server and a http server on the same server
I am using nginx to to serve an instance of PHP application, and also at the same time running a Ratchet app to listen to a websocket connection. Problem is, both of these instance are using the same ...
10
votes
1
answer
88k
views
Can't start mysql service [closed]
I can't restart my mysql service from my ubuntu server. Here is the error :
● mysql.service - LSB: Start and stop the mysql database server daemon
Loaded: loaded (/etc/init.d/mysql; bad; vendor ...
10
votes
2
answers
6k
views
TIME_WAIT consumes file descriptors?
In many TCPIP and Web tunning guide, recommends increasing max number of file descriptors
when getting the error "Too many open files"
but, i can't see TIME_WAIT in outputs of "lsof -i"
Does anyone ...
10
votes
1
answer
35k
views
Netcat not able to bind a listening socket
In my computer with Ubuntu 14.04 I can do things like this:
$ nc -l 5349 -vvv
Listening on [0.0.0.0] (family 0, port 5349)
or this:
$ nc -vvv -l 192.168.254.96 5349
Listening on [192.168.254.96] (...
10
votes
1
answer
8k
views
Create a link to the Unix socket [duplicate]
Is there a possibility to create a hard link for an unix socket? I'm creating a jail and symbolic links won't work, so I'm looking for a solution, how to provide an unix socket inside chrootted ...
10
votes
3
answers
17k
views
Is there any javascript ssh client?
I mean pure javascript client that uses HTML5 sockets and doesn't need to be installed, just open single js file in browser. Is it possible to write such client at all?
10
votes
2
answers
4k
views
Where are my TIME_WAITs on Mac OS X?
No TIME_WAITs on Mac OS X
Normally, when a TCP connection is closed, the socket on the side where close() is called first is left in the TIME_WAIT state.
When one of the peers is a Mac OS X (Lion) ...
9
votes
4
answers
1k
views
how to measure MB/sec on specific socket
We have a web tier where once in a while a web node will slam our data nodes(plural) and if we could see the MB/second coming into that machine on all sockets or on individual sockets, we could ...
9
votes
7
answers
67k
views
ERROR 2002 MYSQL socket /tmp/mysql.sock
A have already read everything about this error but I coundn't solve the problem.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (38)
I'm trying to install ...
9
votes
2
answers
5k
views
Does Mac OS X throttle the RATE of socket creation?
This may seem programming related, but this is an OS question.
I'm writing a small high performance daemon that takes thousands of connections per second. It's working fine on Linux (specifically ...
9
votes
1
answer
20k
views
Connect to Milter service unix:/var/run/opendkim/opendkim.sock: No such file or directory
I've just been moving a postfix mail server to a different box, and I'm having trouble getting postfix to talk opendkim via a unix socket. The opendkim socket is located at /var/run/opendkim/opendkim....
9
votes
1
answer
16k
views
Killing CLOSE_WAIT sockets without killing parent process on Linux
Tomcat is leaving me with CLOSE_WAIT sockets which ultimately saturate the maximum number of connections.
I've tried many methods in my client and server code to get rid of these to no avail, ...
8
votes
3
answers
15k
views
How do you determine what type of CPU socket a linux computer has?
What Linux command/program can I use to tell me what type of CPU socket a Linux desktop has?
I use CPUZ or SIW on windows, and I can use "cat /proc/cpuinfo" on Linux to get the rest of the possessor'...
8
votes
1
answer
7k
views
Apache in linux-vserver won't start, can't create socket
During extensive research and testing to write a proper question worthy of stackexchange I found a solution: rebuild the libapr1 package inside the guest.I thought I'd nevertheless post this ...
8
votes
1
answer
6k
views
Haproxy load balancing with HTTP Headers
We're using HAProxy to load balance our websocket and comet application. There is one HAProxy and 3 applications running in the back.
We use HTTP Basic Auth (and we will use other types of auth in ...
8
votes
1
answer
23k
views
Resource temporarily unavailable while connecting to upstream (php5-fpm)
I frequently get this error on random pages when the are like ~+10K connections (netstat -an |grep 80 |wc -l). This happens while there is still +10GB of free memory and server load is less than 3.
...