Re: net.inet.tcp.sendspace

From: Sean Chittenden (sean_at_chittenden.org)
Date: 06/29/04

  • Next message: fabulous: "Re: net.inet.tcp.sendspace"
    Date: Tue, 29 Jun 2004 10:36:38 -0700
    To: fabulous <fabulous@t7ds.com.br>
    
    

    > Is there any way to change its value according to the connection's uid
    > or port?

    Not with sysctl(8). You can by hacking the application and adding a
    few setsockopt(2) calls, specifically the SO_RCVBUF and SO_SNDBUF
    options. Here's a sample snippit you could follow:

    /* Add these #includes if they aren't already there */
    #include <err.h>
    #include <sysexits.h>

    /* Add this to the top of the function that calls listen(2) */
    int rcvbuf = 4096;
    int sndbuf = 4096;

    /* And add these calls before the application makes its listen(2) call.
      You may find that some applications are already setting their send and
    receive buffer sizes. */
    if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &rcvbuf, sizeof(rcvbuf)) != 0)
       err(EX_OSERR, "setsockopt(2) for SO_RCVBUF failed");

    if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &sndbuf, sizeof(sndbuf)) != 0)
       err(EX_OSERR, "setsockopt(2) for SO_SNDBUF failed");

    > I need small sendspaces to ircd and bigger ones to apache..

    Add the above to each of the applications before they make their
    listen(2) calls. It's a shame more applications don't let you tweak
    this value via a config file.

    -sc

    -- 
    Sean Chittenden
    _______________________________________________
    freebsd-performance@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-performance
    To unsubscribe, send any mail to "freebsd-performance-unsubscribe@freebsd.org"
    

  • Next message: fabulous: "Re: net.inet.tcp.sendspace"

    Relevant Pages

    • Re: Cannot telnet to port 25 from Windows 2003 SBS server to itself
      ... which is I cannot connect from the server on port 25 and send ... I am having this problem on two sbs installations I've done recently. ... those applications to send e-mail, ... Connecting To localhost...Could not open connection to the host, ...
      (microsoft.public.windows.server.sbs)
    • Re: CA Sells Ingres!
      ... Actually Mainwin is a product fron mainsoft corp which helps port VC++ ... applications onto popular versions of Unix & Linux. ...
      (comp.databases.ingres)
    • Re: What Smalltalk product/implementation would you use, and why?
      ... I try to stay relativelive current with the NC versions so I am aware of how hard it would be to port applications from VA to VW. ... The first application I wanted to port, a graphics application that was running too slow under VA, I ported to Dolphin because it was a Windows app, and the native widgets are identicle to those in the users' other applications. ...
      (comp.lang.smalltalk)
    • Re: SMTP and Port 25
      ... We have many applications in Delphi 6 and 7 and when sending E-Mail, we use Indy's SMTP component. ... Lately we have had to unblocked port 25 on the Exchange server in order to make the applications work. ... You could put a SSH server on the exchange box and then add a SSH tunnel component and simply tunnel the port 25 traffic. ...
      (borland.public.delphi.thirdpartytools.general)
    • Re: Carbon, threads, and windows...
      ... I just have to port it to Carbon. ... certainly does not want to write any OS dependant code (or has event the ... This is not the way I usually design my applications, ... have been used in the implementation of the app on a different platform. ...
      (comp.sys.mac.programmer.help)