Writing to /etc/sysctl.conf

502 views
Skip to first unread message

Pierre Ozoux

unread,
Feb 23, 2015, 2:34:18 PM2/23/15
to coreo...@googlegroups.com
Hi!

I just hit my first scalabilty issue, and I'm quiet happy 
https://microblog.pierre-o.fr/2015/hitting-my-first-scalling-issue-o---mysql-and-aio-max-nr

To solve this, I had to modify the value of fs.aio-max-nr

My question is, what is the best way in your opinion to persist this?
I think, I should write it with cloud-config, but it is just as a
confirmation that I'm asking you 

something like:
write_files:
  - path: /etc/sysctl.conf
    permissions: 0644
    owner: root
    content: |
      fs.aio-max-nr = 1048576

It is really just to know about best practive for this kind of matter,
like modifying kernel options.

Thanks for your help!

Pierre

Scott Laird

unread,
Feb 23, 2015, 3:00:53 PM2/23/15
to Pierre Ozoux, coreo...@googlegroups.com
I'm doing something like this:

write_files:
  - path: /etc/sysctl.d/baselayout.conf
    content: |
      net.ipv4.tcp_tw_recycle = 1
coreos:
  units:
    - name: systemd-sysctl.service
      command: restart


--
You received this message because you are subscribed to the Google Groups "CoreOS User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coreos-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alex Crawford

unread,
Feb 23, 2015, 3:08:05 PM2/23/15
to Pierre Ozoux, coreo...@googlegroups.com
> --
> You received this message because you are subscribed to the Google Groups "CoreOS User" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to coreos-user...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Using write_files is the correct way. You should write into
/etc/sysctl.d/*.conf instead. You'll also need to re-evaluate the sysctl
config after it's been written.

#cloud-config
write_files:
- path: /etc/sysctl.d/aio-max.conf
permissions: 0644
owner: root
content: "fs.aio-max-nr = 1048576"
coreos:
units:
- name: systemd-sysctl.service
command: restart

-Alex

Michael Marineau

unread,
Feb 23, 2015, 3:33:56 PM2/23/15
to Scott Laird, Pierre Ozoux, coreos-user
Note: the file /etc/sysctl.d/baselayout.conf will replace the defaults that we ship in /usr/lib/sysctl.d/baselayout.conf which may be your intent but just want that to be clear for anyone reading this thread.

Pierre Ozoux

unread,
Feb 24, 2015, 9:23:15 AM2/24/15
to Michael Marineau, Scott Laird, coreos-user
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thanks for your great help!
I'll update my blog post to make reference to this for CoreOS users.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJU7IlMAAoJEJQmWmdBDUs8Gf0QAMBOwsUcTZBnxU+NacWvrv0s
JC1fVQpFSpQe6lN1+rlaY4Hfecim2jSBq5sScLg5jK272R/oY1va3dikENJG80sk
nCKDReZj9loDsj3rrEKnCh5cbrWfCyp2z9f3vS7CkL6pUGhOnF3/ZM7eJfujp4V5
QOb1pbI0h2JTkXH5cD6ErNRHIDLrPJwKFOxZe/RisEXq19fOhJ5tWADeQmlRyfzn
ni62y3fshj3QCJtcE1qcwoqpl5IdvuhjHpGXfEhg0+rbKR2oMnfVypqAGC0OvF6y
QadWxzc2XaeaILT1PFXyZyWTAMrCTZayyHN9XO0YdnWLCbQKwKxmPCiyDcPU3p1q
VoR4vO/Rpb5B3jSlcFvb/uMALmhordvM56kK6RQruMi7EJiqelyx/5HMz1InfWi8
20/moCp689f0OIjSUz/kBIM+/mwcXdoW+sNAZRVIxb7KfbeC7w2VE1Fn63+95/zH
Z5eJq5VJzpz9FgkWBmyPMFrn8tMBrl7yNIK2vBtLyOUGH9rfXLDrAbs79sl2LR+n
Wr6Nm+pa0uA5lwmC+LPJZfVxldt2JhEvY+orrXy4oed6cMYcAkD1LnAj+0Jk6QpV
pTLhv5AuBeRys8GF04ZUDfs4U4ftJ+V6ASwI/DeoRO9zDz9ymS+3aDSuZxY05nQx
pVb2AJT34V6mggRbzPKF
=OH92
-----END PGP SIGNATURE-----
Reply all
Reply to author
Forward
0 new messages