{"id":23449947,"url":"https://github.com/natefoo/smf-nettune","last_synced_at":"2026-02-01T00:09:29.157Z","repository":{"id":33680124,"uuid":"37332874","full_name":"natefoo/smf-nettune","owner":"natefoo","description":"Tune ndd/ipadm properties on illumos/Solaris at boot via SMF","archived":false,"fork":false,"pushed_at":"2015-06-12T19:24:15.000Z","size":124,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-13T21:04:52.637Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/natefoo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-12T16:36:39.000Z","updated_at":"2020-09-24T15:48:28.000Z","dependencies_parsed_at":"2022-09-09T05:01:41.339Z","dependency_job_id":null,"html_url":"https://github.com/natefoo/smf-nettune","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/natefoo/smf-nettune","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natefoo%2Fsmf-nettune","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natefoo%2Fsmf-nettune/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natefoo%2Fsmf-nettune/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natefoo%2Fsmf-nettune/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/natefoo","download_url":"https://codeload.github.com/natefoo/smf-nettune/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natefoo%2Fsmf-nettune/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28961266,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T23:03:11.038Z","status":"ssl_error","status_checked_at":"2026-01-31T22:56:44.691Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-23T23:31:12.826Z","updated_at":"2026-02-01T00:09:29.139Z","avatar_url":"https://github.com/natefoo.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"smf-nettune\n===========\n\nThis script/manifest allows you to define parameters tunable by ipadm or ndd\nwhich can then be applied and unapplied through Solaris SMF.\n\nBased on the original concept by Hung-Sheng Tsao:\n\n  https://blogs.oracle.com/hstsao/entry/smf_and_tcp_tuning\n\nMy enhancements place ipadm/ndd parameters directly into SMF instead of\nhardcoded in the method as in the original.\n\nAdditional changes include the use of ipadm on Solaris 11 and illumos as\nexplained by Steffen Weiberle:\n\n  https://blogs.oracle.com/stw/entry/solaris_11_express_network_tunables\n\nIf ipadm exists, it will be used over ndd. Be sure to check the output of\n`ipadm show-prop tcp` on your system for property names, as they vary slightly\nby release, and also differ from the ndd names.\n\nThe tuning values in this example originally came from the following page, but\nwere modified based on additional feedback from PSC network engineers for the\nbest 10GB performance:\n\n  http://www.psc.edu/index.php/component/content/article/12-about/employment/641-tcp-tune#Solaris\n\nTo use ndd names not exposed through ipadm with ipadm, they must be prepended\nwith an underscore, however SMF property names may not begin with an\nunderscore. To set these tunables (e.g. `_cwnd_max`) create a property with the\nleading underscore replaced with an uppercase `U` (e.g. (`Ucwnd_max`)).\n\npreseed\n-------\n\nOn SmartOS, it is not possible to set the property values since SMF is\nessentially created from scratch on each boot. Because of this, you can create\na preseed file (by default, `/opt/custom/etc/nettune_preseed.conf` which will\npopulate the SMF values from this file. Its format is:\n\n```\n\u003cdevice\u003e \u003cproperty_group\u003e \u003cproperty\u003e \u003cproperty_val\u003e\n```\n\nE.g. for ipadm:\n\n```\ntcp send_buf integer 16777216\ntcp recv_buf integer 16777216\ntcp max_buf integer 33554432\ntcp Ucwnd_max integer 33554432\n```\n\n\nusage\n-----\n\n1.  Copy the nettune script to somewhere appropriate for your environment and\n    make sure it is executable.  By default, the SMF config expects to find it\n    in `/lib/svc/method`.\n\n2.  Copy network-nettune.xml to `/var/svc/manifest/site` (or on SmartOS, to\n    `/opt/custom/smf`).  Edit the XML config file if you put nettune somewhere\n    other than `/lib/svc/method`.\n\n3.  Import the manifest:\n\n    ```console\n    # svccfg import /var/svc/manifest/site/network-nettune.xml\n    ```\n\n4.  Create property groups for the protocols (ipadm) or devices (ndd) you wish\n    to tune:\n\n    ```console\n    # svccfg -s nettune addpg tcp application\n    ```\n\n    For ndd, the property group is translated to the device passed to ndd by\n    prepending `/dev/` to the property group name.\n\n5.  Set some parameters (ipadm):\n\n    ```console\n    # svccfg -s nettune setprop tcp/send_buf = integer: 16777216\n    # svccfg -s nettune setprop tcp/recv_buf = integer: 16777216\n    # svccfg -s nettune setprop tcp/max_buf = integer: 33554432\n    # svccfg -s nettune setprop tcp/Ucwnd_max = integer: 33554432\n    ```\n\n    Or ndd:\n\n    ```console\n    # svccfg -s nettune setprop tcp/tcp_xmit_hiwat = integer: 16777216\n    # svccfg -s nettune setprop tcp/tcp_recv_hiwat = integer: 16777216\n    # svccfg -s nettune setprop tcp/tcp_max_buf = integer: 33554432\n    # svccfg -s nettune setprop tcp/tcp_cwnd_max = integer: 33554432\n    ```\n\n6.  Create an SMF snapshot that includes your new values:\n\n    ```console\n    # svcadm refresh network/tune\n    ```\n\n7.  Check your current values before enabling:\n\n    ```\n    % ipadm show-prop -p send_buf tcp\n    PROTO PROPERTY              PERM CURRENT      PERSISTENT   DEFAULT      POSSIBLE\n    tcp   send_buf              rw   128000       --           128000       4096-1048576\n    % ndd -get /dev/tcp tcp_xmit_hiwat\n    128000\n    ```\n\n8.  Enable the service.\n\n    ```console\n    # svcadm enable network/tune\n    ```\n\n9.  Check the new values to make sure it worked:\n\n    ```console\n    % ipadm show-prop -p send_buf tcp\n    PROTO PROPERTY              PERM CURRENT      PERSISTENT   DEFAULT      POSSIBLE\n    tcp   send_buf              rw   16777216     --           128000       4096-1048576\n    % ndd -get /dev/tcp tcp_xmit_hiwat\n    16777216\n    ```\n\n10. You can disable the service to reset the tunables to their previous values,\n    since the previous values are stored whenever the service is enabled.\n    These previous values are stored in an SMF property group named like the\n    one(s) you created, but with `_defaults` appended:\n\n    ```console\n    % /usr/bin/svcprop -p tcp_defaults network/tune\n    tcp_defaults/send_buf integer 128000\n    tcp_defaults/recv_buf integer 128000\n    tcp_defaults/max_buf integer 1048576\n    tcp_defaults/Ucwnd_max integer 1048576\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatefoo%2Fsmf-nettune","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnatefoo%2Fsmf-nettune","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatefoo%2Fsmf-nettune/lists"}