231 reputation
419
bio website facebook.com/thenonsequitur
location New York, NY
age 31
visits member for 3 years, 11 months
seen Nov 29 at 9:12
puts 10.downto(1).each{ |i| puts i }
puts 'Blast off!'

puts (10.downto(1).map{ |i| i.to_s } + ['Blast Off!']).join("\n")

(1..10).to_a.reverse.each{ |i| puts i }
puts 'Blast off!'

Apr
8
comment Always get “SIOCADDRT: File exists” when restarting networking on ubuntu
There is also an "upstart" script for both up and down, but I'm not using upstart here, I'm using the init.d script. Besides, both upstart scripts seem to be there, one running net-device-up and one running net-device-down. So anything that gets set should get unset first, so I don't think that would be the problem even if I were using these scripts.
Apr
8
comment Always get “SIOCADDRT: File exists” when restarting networking on ubuntu
@javano, thanks I didn't know about those. Unfortunately, none of them seem to be the problem. There are a few scripts for various services, but none of them modify the interface or mess with ip addresses or routes -- they seem to just be netowrk-dependent services that need to to do something when the network starts or stops (ntpdate, sshd, etc...)
Apr
8
comment Always get “SIOCADDRT: File exists” when restarting networking on ubuntu
@javano, is there any way to test this? As far as I know, in Ubuntu, the /etc/network/interfaces file specifies everything that happens on ifup and ifdown, and what I put in the question is the full interfaces file. I know redhat and some other linuxes have a sysconfig directory for additional networking scripts, but I don't think Ubuntu has that.
Mar
4
comment Need to increase nginx throughput to an upstream unix socket — linux kernel tuning?
@tarkeshwar, no, never figured it out. Eventually ended up going with different hardware and and somewhat different server stack instead of solving the problem.
Nov
29
comment What does #53 mean in nslookup nameserver address result?
oh, duh. thanks! will accept you ranswer when the timer allows me to.
Aug
16
comment What are the actual benefits of assigning sudo privileges to a user instead of using root?
Also: it's more difficult to royally mess your system up if you make a catastrophic command mis-type running as low-privileged user.
Aug
16
comment What are the actual benefits of assigning sudo privileges to a user instead of using root?
@voretaq7, good answer! Another important aspect of sudo that I think you should add to the list: It lets you easily run command with superuser privileges but with your regular user environment variables and shell settings. This can be accomplished without sudo, but sudo makes it easy.
Jun
28
comment Need to increase nginx throughput to an upstream unix socket — linux kernel tuning?
I added my ulimit settings to the end of the question.
Jun
28
comment Need to increase nginx throughput to an upstream unix socket — linux kernel tuning?
Nope, ulimit settings on both machines are the same (specifically open files is 65535, everything else looks fine too).
Jun
28
comment Need to increase nginx throughput to an upstream unix socket — linux kernel tuning?
Throughput between each machine and a db machine is the same now, and latency between the new machine and db machine is about 30% more than between old machine and db. But 30% more that a tenth of a millisecond is not the problem.
Jun
28
comment Need to increase nginx throughput to an upstream unix socket — linux kernel tuning?
same problem with even a worse magnitude using tcp/ip (write queue climbs even faster). I have nginx / unicorn / kernel all set up exactly the same (as far as I can tell) on a different machine, and that other machine is not exhibiting this problem. (I can switch dns between the two machines, to get live load testing, and have dns on a 60-sec ttl)
Jun
28
comment Need to increase nginx throughput to an upstream unix socket — linux kernel tuning?
Got a new server moved to a location to provide adequate throughput, completely rebuilt the system, and still have the same problem. So it turns out my problem is unresolved after all... =( I still think it's app-specific, but can't think of anything. This new server is set up exactly like another server where it's working fine. Yes, somaxconn and netdev_max_backlog are st up correctly.
Jun
28
comment How to set the default source (src) ip address when you have mulitple IP's on a virtual interface
@foocorpluser, thanks for this! This solved a similar problem for me. You might want to consider posting your solution as an actual answer here instead of just leaving it as an edit in your question.
Jun
20
comment Need to increase nginx throughput to an upstream unix socket — linux kernel tuning?
I figured out the problem. See the answer I posted. It actually was the app bottlenecking, not the socket, just as you posit. I had ruled this out earlier due to a mis-diagnosis, but turns out the problem was throughput to another server. Figured this out just a couple hours ago. I'm going to award you the bounty, since you pretty much nailed the source of the problem even despite the mis-diagnosis I put in the question; however, going to give the checkmark to my answer, because my answer describes the exact circumstances so might help someone in the future with a similar issue.
Jun
19
comment Need to increase nginx throughput to an upstream unix socket — linux kernel tuning?
Thanks for the idea, but this didn't appear to make any difference.
Jun
15
comment Need to increase nginx throughput to an upstream unix socket — linux kernel tuning?
@Khaled, ulimit -n says 65535.
May
23
comment Multiple Linux sysadmins working as root
+1.. I'd go further than saying "The second option is the best". I'd it's the only reasonable option. Options one and three vastly decrease the security of the system from both outside attacks and mistakes. Besides, #2 is how the system was designed to be primarily used.
Apr
3
comment apt-get duplicate sources.list entry for google-chrome (Ubuntu 11.10)
Yes, but after running apt-get a second time in a row, I wouldn't get errors the second time. Not that important, though. Problem solved is the important part!
Apr
3
comment apt-get duplicate sources.list entry for google-chrome (Ubuntu 11.10)
That fixed it thanks! Will mark this accepted when I can in 8 minutes :). Any idea why the warnings only showed up part of the time?
Mar
21
comment Not able to delete lot of files at once in linux
This isn't an directly related to your question, but after you succeed in deleting these old logs, look into logrotate to avoid this problem in the future: linuxcommand.org/man_pages/logrotate8.html