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.

learn more… | top users | synonyms

64
votes
7answers
89k 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 ...
18
votes
5answers
17k 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 ...
18
votes
2answers
8k 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 ...
16
votes
3answers
11k views

What's the difference between Unix socket and TCP/IP socket?

It's from this answer: http://stackoverflow.com/questions/2482411/is-this-pdo-bug-fixed-now/2482424#2482424
12
votes
3answers
10k 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 ...
11
votes
6answers
18k 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 ...
10
votes
4answers
18k 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 ...
9
votes
4answers
10k 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 ...
9
votes
4answers
8k 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 ...
8
votes
4answers
633 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 ...
8
votes
5answers
15k 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 ...
8
votes
1answer
4k 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
3answers
2k views

Can I make TCP/IP session to run less than 60 seconds?

Our server is overloaded with TCP/IP sessions, we have 1200 - 1500 of them. Most of them are hanging in TIME_OUT state. It turns out that a connection in TIME_OUT state occupies a socket until 60 ...
8
votes
3answers
8k 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 ...
8
votes
5answers
13k 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 ...
7
votes
2answers
5k views

Create Unix Named Socket from the Command Line

Is there a command similar to mkfifo but for domain sockets?
7
votes
3answers
337 views

Should a web server care about IPv6 compatibility?

Are there any IPv6 clients in the real world? If not, is there any other reason to support IPv6? (My understanding is that with the advent of WANs and such IPv6 is not necessary, hence extremely low ...
7
votes
3answers
4k 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?
7
votes
3answers
28k 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. ...
6
votes
5answers
4k 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 ...
6
votes
3answers
10k 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 ...
6
votes
5answers
1k views

Is there still a reason why binding to port < 1024 is only authorized for root on Unix systems?

On Unix systems, binding to tcp port < 1024 from a process without root privileged is denied. What was the initial reason and is it still valid ? For example http server don't need root ...
6
votes
5answers
4k 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 ...
6
votes
2answers
2k 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 ...
6
votes
1answer
2k 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 ...
6
votes
5answers
6k 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 ...
6
votes
2answers
2k views

Sharing unix socket via docker volume - permission denied

I try to share my php5-fpm socket via a volume with my nginxwebserver. Fpm and nginx are running if different containers and I want to get them working via a shared volume where I place the socket ...
6
votes
3answers
994 views

Does having a load balancer allow you to re-use socket connections?

I have a service where servers upload 20kb xml files to my server. There is no session, it is a single POST request and that's it. Each individual request is authenticated based on the contents of ...
5
votes
1answer
4k 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 ...
5
votes
2answers
9k 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, Form what I'v read, I know that I need to create a memcache.socket and add ...
5
votes
1answer
2k 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 ...
5
votes
2answers
2k 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 ...
5
votes
5answers
1k views

Websockets Server with Fault-Tolerance and Durable Message Store

I am starting to experiment with websockets. Does anyone know of a websockets server (open source or paid) that provides a durable store of the websocket "channel"? All of the examples that I have ...
5
votes
1answer
2k 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 ...
5
votes
3answers
5k views

Linux web servers that support websockets?

I'm currently having a lots of difficulties trying to play with socket.io which needs websockets support from the server (reverse-proxying). I was wondering, is there any other web servers out there ...
5
votes
1answer
4k views

Is it possible to close a socket with a shell command?

Is it possible to close a socket by using some sort of shell command/program? I've seen plenty of examples of manipulating sockets using C and other languages but have been unable to find a program ...
5
votes
1answer
819 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) ...
4
votes
3answers
260 views

How to get sockets which are listening on a specific port in linux?

An application may be binding multiple sockets to a specific port,how can I get those sockets command line?
4
votes
2answers
6k 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 ...
4
votes
4answers
8k 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 ...
4
votes
1answer
648 views

How to check if a process is non-blocking in linux without using a stack tracer?

A multi-cpu server is running several processes. One process has a thread that should always be in a spinning state, using 100% of the CPU it's been assigned. My current method (besides asking the ...
4
votes
2answers
1k views

Why can't I attach a screen session

I've got a screen session running which I would like to :quit, but I can't because when I try to re-attach, I get an error saying it can't open my terminal. I'm sure I could kill the daemon or ...
4
votes
2answers
7k views

Exhausting Linux machine TCP socket limit (~70k)?

I am the founder of torservers.net, a non-profit that runs Tor exit nodes. We have a number of machines on Gbit connectivity and multiple IPs, and we seem to be hitting a limit of open TCP sockets ...
4
votes
2answers
2k views

Are there any drawbacks to running memcached on a Unix domain socket instead of the network (assuming one server)?

I’m setting up a Django website to use memcached to cache its pages. (The content of each page won’t change very often at all, so I’m hoping that most of the site will be served from memcached most ...
4
votes
2answers
506 views

Are serial-to-ethernet adapters interchangeable?

I need to get data from a serial device (a weather station) over our network where it'll be processed by a Unix host (using custom software). I was able to compile remserial which makes the remote ...
4
votes
1answer
1k views

SElinux label for php-fpm sockets

I'm attempting to set up multiple instances of php-fpm to run multiple versions of php through apache 2.2 running on centos 6.5. At some point in the future this will end up in a shared hosting ...
4
votes
1answer
463 views

Is there a way to show list of all open sockets on a Windows server and the socket properties?

We are using a third party library in one of our applications. We would like to find a tool which will list all of the open sockets on the machine AND give us the ability to see the various TCP ...
4
votes
1answer
3k views

TCP Windows Size vs Socket Buffer Size on Windows

I am new to Windows networking. When people talk about TCP tuning on Windows platform, they always mention about TCP Window Size. I am wondering whether Windows uses the concept of "Socket Buffer ...
3
votes
3answers
6k 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 ...
3
votes
2answers
2k views

Nginx to apache reverse proxy, instruct use of unix sockets

My Nginx reverse proxy works on the same machine as the webserver(apache) as follows server { server_name site.net; location / { proxy_pass http://localhost:82; ...