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.

142 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
12 votes
0 answers
656 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:...
Josh's user avatar
  • 9,208
7 votes
0 answers
2k views

How to deploy a WebSocket application without downtime?

Deploying HTTP applications without downtime isn't that hard: HTTP is stateless, so with a load balancer in front of 2 HTTP applications solves the problem. If both applications use a common backend ...
Florian Margaine's user avatar
6 votes
2 answers
30k views

Unable to restart a systemctl service remotely as a non root user

I have a systemd.socket named gunicorn.socket which I would like to restart after updating some code on a remote server. I've followed the steps detailed in Allowing a non-root user to restart a ...
marcanuy's user avatar
  • 268
5 votes
0 answers
1k views

What SELinux type should I apply on my Unix socket?

I have a Gunicorn socket file: /opt/rtd/gunicorn/run.sock. I need nginx to be able to open this socket and write to it. When I run sesearch --allow -s httpd_t | grep unix_stream_socket I noticed that ...
Christoffer Reijer's user avatar
5 votes
2 answers
582 views

timing issue after route add/delete (route not used)

I have an application that is running a raw IP socket, destination of this socket is governed by routes installed via the 'ip route add' command. These routes can change during the lifetime of a ...
KillianDS's user avatar
  • 151
4 votes
0 answers
652 views

How to find out which kernel module opened a socket?

When I try to find the process for an opened socket using e.g. ss I get the following output: ❯ sudo ss -tulpen Failed to open cgroup2 by ID Failed to open cgroup2 by ID Netid State Recv-Q Send-Q ...
sneusse's user avatar
  • 141
4 votes
0 answers
4k views

rails server using nginx + puma on ubuntu - suddenly get socket connect failed errors

I have ran jruby on rails in AWS ubuntu trusty 14.04 configuration. my server was going well during several hours. but suddenly get socket connect failed error. -nginx error.log 2016/03/12 10:12:10 [...
mjkim's user avatar
  • 141
4 votes
1 answer
3k views

SSL - Apache and Node.js on the same Amazon EC2 instance

I hosted my website on an EC2 instance, using Apache. SSL was also set up properly, running on HTTPS, port 443. Currently, I just added a chat application to the website using Node.js + socket.io. ...
Danh Nguyen's user avatar
4 votes
0 answers
2k views

Can nginx set 'Origin' header when proxing websocket?

We know nginx can proxy WebSocket since version 1.3.13, and we also know some times WebSocket server will valid the 'Origin' header, so someone said you can do something like: proxy_set_header Origin ...
pingz's user avatar
  • 213
4 votes
0 answers
9k views

Nginx websocket 502 bad gateway

I'm trying to use nginx as proxy for websocket nodejs server, but I'm always getting 502 bad gateway. my domain config: upstream server { server 127.0.0.1:8090; } server { listen 8085; ...
zajca's user avatar
  • 203
4 votes
0 answers
866 views

mysql client slow login strace

I am experiencing an issue with slow connections/logins to a loaded mysql server, even when connecting via the unix socket file (CentOS 6.3). Queries are completing very quickly -- (0.00 sec) in this ...
carillonator's user avatar
3 votes
0 answers
221 views

How to tell whether a linux tcp socket had recent activity?

Most of the time, when changing or upgrading a network service, I would do this during maintenance hours but some services are rarely used so it is tempting to just check whether it is currently in ...
Gamification's user avatar
3 votes
1 answer
573 views

Start systemd socket on VPN connection automatically after boot

One of my servers is setup so that it will automatically connect to a VPN after booting up using a systemd service. Now I want to host a systemd socket on this VPN connection. And the socket should ...
rollstuhlfahrer's user avatar
3 votes
0 answers
3k views

Reaching maximum TIME_WAIT sockets (tried tcp_fin_timeout)

tl;dr: How do i get the kernel to drop TIME_WAIT/closing sockets as forcibly and fast as possible? I don't care about data being lost since I'm not sending any. I'm currently running a little test ...
Torxed's user avatar
  • 235
3 votes
0 answers
468 views

Firewall : Is inbound required for getting response while Outbound rule already there?

I developed one MVC web application which have Web APIs and hosted in Amazon Instance and one windows application for calling those APIs for getting response from that server. Both Web and Windows ...
Abhishek Parmar's user avatar
3 votes
0 answers
3k views

Docker: Nginx and hhvm socket configuration returns 502 Bad Gateway

I am trying to run nginx and hhvm with docker-compose and socket file configuration but it returns a 502 error. I can access to conf/hhvm/run/ from nginx and hhvm image. In the error.log nginx's file ...
Avel's user avatar
  • 31
3 votes
0 answers
3k views

Can't connect to (or write to) a socket file, despite being owner?

I am working on Debian Jessie with Django 1.8, trying to set up Gunicorn to run my Django site. I have made a user called opuser, and made this user the owner of the gunicorn.sock file and of the ...
Richard's user avatar
  • 263
3 votes
0 answers
1k views

Performance issues with Apache + Django + socket.io (long-polling) + Proxy

I'm trying to set up a website with django, apache and socket.io. Thanks to some tutorials and other stackoverflow questions, I managed to make everything work, except for a severe lag, that occurs ...
basilikum's user avatar
  • 217
3 votes
2 answers
5k views

Unable to access 3ware 3dm2 web interface, failed to start listening socket

I am unable to get to the 3ware 3dm2 web interface. When I attempt to execute 3dm2 from the command line, i get the following error "(0x0C:0x0005): Failed to start listening socket". This was working ...
harmonic's user avatar
3 votes
1 answer
966 views

Socket.io Flashsockets over HTTPS

We’re trying to get Socket.io flashsockets to work in Internet Explorer 9 over HTTPS/WSS. The flashsockets work over HTTP, but HTTPS is giving us problems. We’re using socket.io version 0.8.7 and ...
Justin Meltzer's user avatar
2 votes
0 answers
100 views

Cannot connect to a port on Ubuntu 22.04 x64

I have MySQL running on port 1835, as proven by running the command: lsof -i:1835 The following was run to open the port on the firewall: ufw allow 1835/tcp ufw enable ufw reload But the port cannot ...
Andy's user avatar
  • 21
2 votes
1 answer
688 views

How do I "watch" a unix socket to see what requests are coming through?

My nginx is forwarding its incoming http web requests to a local unix socket (unix:/var/run/foo.sock). On the other end I have a separate web server (puma + ruby on rails, if it matters) reading from ...
user2490003's user avatar
2 votes
1 answer
3k views

gpsd.socket for chrony does not work

I tried to get more accurate time from gps data using ublox module and centos but it seems gpsd.sock does not work properly to get the data to chrony. am I missing somthing ? [root@info /]# cat /etc/...
Bell-guest's user avatar
2 votes
0 answers
3k views

PHP-FPM doesn't create the socket when run as non root user

I am creating a Docker image that run NginX and PHP-FPM (with Supervisor). The container is run as www-data, but the PHP-FPM socket is not created. Here are my config files : www.conf [www] listen =...
M4kn4sh's user avatar
  • 121
2 votes
0 answers
3k views

What to set uwsgi uid and gid to?

I'm trying to have nginx connect to a uwsgi socket on FreeBSD. I've set the socket to 666 but whenever I issue a request in my browser I can see the following in my nginx logs: 2017/12/12 11:34:04 [...
ruipacheco's user avatar
2 votes
0 answers
1k views

Getting systemd-journald (219) to listen somewhere other than /dev/log

I would like systemd-journald in systemd 219 (on el7, so the package is systemd-219-30.el7_3.9.x86_64) to listen for syslog messages on /run/systemd/journal/dev-log, and have /dev/log be a symlink to ...
larsks's user avatar
  • 44.6k
2 votes
0 answers
8k views

400 Bad Request while creating websocket between client and nodejs with Nginx as reverse proxy

I am trying to create a websocket using Nginx as a reverse proxy and nodejs at the back. I'm using ws library in nodejs. When I test it using wscat tool everything works fine but as I make request ...
Satys's user avatar
  • 193
2 votes
1 answer
2k views

Can HAProxy reconnect a websocket to another backend server transparently?

I'm new to HAProxy so this might have an obvious answer but I wasn't able to find it. Consider this setup: two backend web applications; one HAProxy in front of the web applications; many clients ...
bdem's user avatar
  • 121
2 votes
1 answer
2k views

high traffic websocket/haproxy tuning

i have a pubsub application (mostly chat but some other goodies being pub-ed and sub-ed too) running on node & socket.io. i'm load testing this app by spinning up some other, real large, boxes ...
hackerhasid's user avatar
2 votes
0 answers
539 views

what can put linux process managing connection pool into bad state, so it restarts them continously?

I have an application with pool of connections to MySQL. At some point, in production, every 1-3 seconds some socket is closed. As a result my app restarts this connection. This is pretty big pool ...
user1971693's user avatar
2 votes
0 answers
2k views

windows server 2003 socket connections limit

I'm trying to establish many(the more - the merrier) socket connections on Windows 2003 server. I make several server sockets and connect to them from current computer (1 server socket serves 1 ...
Natalia's user avatar
  • 21
2 votes
2 answers
2k views

Lighttpd with FastCGI won't create /tmp/fcgi.sock on startup?

I'm running lighttpd-1.4.19 on a debian 5 box and try to run web2py with fastcgi. The problem with that is, that lighttpd does not create the socket file /tmp/fcgi.sock. If I'm creating the file by ...
Marlon's user avatar
  • 21
2 votes
2 answers
935 views

Linux: How to display all sockets opened for a particular interface?

How can I display all sockets opened for a particular interface?
user avatar
1 vote
0 answers
143 views

What does it mean when netstat outputs a dash in pid / program name column?

Here is some lightly modified output from netstat (I removed the addresses and names) a@xxxxx:/app# netstat -p Active Internet connections (w/o servers) Proto Recv-Q Send-Q Local Address ...
zelinka's user avatar
  • 111
1 vote
0 answers
685 views

clamav-daemon doesn't create /var/run/clamd.ctl

I installed clamav-daemon on Debian 11 and when I try to start it, it doesn't create the LocalSocket /var/run/clamd.ctl. LocalSocket in my /etc/clamav/clamd.conf: LocalSocket /var/run/clamav/clamd....
afriend's user avatar
  • 111
1 vote
0 answers
807 views

Client Listening on 0.0.0.0 when custom network interface doesn't exist?

I'm facing an issue in our environment where I'm starting a ServerSocket (Java), and configuring it to listen on 0.0.0.0. Then I'm creating a network interface, and my client is attempting to connect ...
Aditya Chandel's user avatar
1 vote
0 answers
92 views

Reached pm.max_children, High sockets allocated, No CPU usage

The issue I have a server that reaches pm.max_children (200) without spike in CPU usage. No network traffic (MB out / MB in) but extremely high number of socket allocated that do not get closed. CPU: ...
Aidvi's user avatar
  • 46
1 vote
0 answers
225 views

How to open communication PYTHON socket with a SERVER SOCKET on AWS EC2 to a CLIENT SOCKET on my local pc?

Sorry my english is not good I want to established connexion from my client socket on my local pc to a host server socket on AWS EC2 instance. I'm trying to follow suggestions from here and code from ...
Citoyen x14's user avatar
1 vote
0 answers
53 views

How are Linux ACLs different for files versus sockets

With umask 0022, using default ACL entries default:user::rwx, default:group::rwx, default:mask::rwx and default:other::rwx for a directory, files created with touch (e.g.) have a mask of rw, and ...
Larry's user avatar
  • 11
1 vote
0 answers
253 views

How to create multiple pools on LEMP Stack, PHP 8.1?

I need to optimize my web app performance, with that in mind I created two PHP-FPM pools for frontend and backend and their respective users. Both pools are listening to different sockets on /etc/php/...
AtomX's user avatar
  • 125
1 vote
0 answers
76 views

Sockets: divergence in behaviors between linux and windows when binding to INADDR_ANY *and* another address with the same port

Say one attempts to bind two sockets respectively on the two addresses "0.0.0.0:12345" and "127.0.0.1:12345". Depending on the platforms I tested this on, the behavior changes. On ...
Fabio A.'s user avatar
  • 111
1 vote
1 answer
1k views

IPTables log connection pid on OUTPUT chain

I'm trying to find pid of a socket using iptables OUTPUT chain log, or even better adding it into the log. My current iptable rule: sudo iptables -A OUTPUT -j LOG --log-prefix='[PID]' --log-level 7 --...
Or Yaacov's user avatar
1 vote
0 answers
1k views

nginx logging to unix socket fails with protocol error

debian stable, nginx version: nginx/1.14.2 I get the following error message (error.log) : connect() failed (91: Protocol wrong type for socket) configuration file : access_log syslog:server=unix:/var/...
Nozz's user avatar
  • 13
1 vote
0 answers
504 views

Enable GRO for UDP port explicitly

I am implementing a simple socket application in python and I need it to receive UDP packets with GRO enabled. I have checked that only the Python service is running and that GRO is enabled via ...
tombjarne's user avatar
1 vote
0 answers
284 views

Get information about socket of unknown domain

The output of lsof (revision: 4.87) on centos 7.8.2003 shows: COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME java 30858 xxxx 841u sock 0,7 ...
William Pursell's user avatar
1 vote
1 answer
113 views

How I can continuously log processes connected to a socket

I have a project with an architecture based on a RabbitMQ queue. Each day at 00:30 triggered by a CRON job, the producer process gets the information from a web page and writes in the queue in order ...
mapedraza's user avatar
1 vote
1 answer
725 views

Postfix over proxy like SOCKET or SSH tunnel

I'm trying to send mail over proxy (SSH tunnel or SOCKET proxy) by postfix. I tried to do something like that schema: I'm using MacOs with no firewall. The receiving client over browser has been ...
Santino Santona's user avatar
1 vote
1 answer
888 views

SELinux, Nginx and fcgiWrap: how to allow access to fcgiWrap socket?

I am under Fedora 31 (linux kernel 5.4.13, Nginx 1.16.1, fcgiwrap 1.1.0) running with SELinux in enforcing mode (policy: targeted 3.14.4-44.fc31). My box hosts a server driven by Nginx. Part of it ...
ajlittoz's user avatar
  • 111
1 vote
1 answer
840 views

Socket send redirected to a different interface than what it is bound to

There are 2 NICs (network interface cards) with IPs IP0 and IP1 as primary addresses given to them as seen in the kernel routing table via ip route. Say a TCP socket is bound to IP0 (and some port P0)....
ustulation's user avatar
1 vote
0 answers
445 views

git-http-backend blocking with fastcgi on nginx

I have git-http-backend serving git repos through an nginx fastcgi proxy. The nginx config looks like: server { listen 443 ssl; server_name git.example.com; ...
trbabb's user avatar
  • 131