From owner-freebsd-doc@FreeBSD.ORG Wed Dec 19 03:58:58 2012 Return-Path: Delivered-To: freebsd-doc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EFCFD532 for ; Wed, 19 Dec 2012 03:58:58 +0000 (UTC) (envelope-from edward@rdtan.net) Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by mx1.freebsd.org (Postfix) with ESMTP id B8B0A8FC0C for ; Wed, 19 Dec 2012 03:58:58 +0000 (UTC) Received: by mail-pa0-f47.google.com with SMTP id fa10so997793pad.34 for ; Tue, 18 Dec 2012 19:58:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding:x-gm-message-state; bh=T+AUhbBijFcNpM2VTDZVFs6NN2FjvbLSlcfytxkNqAU=; b=mE1smU0wPNu9bC7Z0niF2EkOkvk7rtXgrQsxoDP5lSaOBTBG6bxgKrsdVfaebGcBxG FCnSgbFziJSDiSWXHHhHceiNEttpLGIJ84jXBD9lrooIhPovBPOZye2Zb8W/2sf/VQmO LMO2mXMxfhwPZm+hqzhD8H+OH9xmrHHWUYI0LB5fE8zzEO8lzEYiotTa9602/Ni8u08r +uXKSTXFMK3E71jo9EkXoKv3036ipJJRFuR9w1+ylcuo9ut+EAfDtjhdn1g+duqz8XiV 2TP0WoD4H7iBWDwzgldN6DAkg/4lVuL+vuHbmxX6SBVgVKpIMWsW2Tvm9XWJytLBCior +vBw== X-Received: by 10.68.223.35 with SMTP id qr3mr14142165pbc.27.1355889110483; Tue, 18 Dec 2012 19:51:50 -0800 (PST) Received: from zion.local ([175.136.182.84]) by mx.google.com with ESMTPS id mt15sm2283771pbc.49.2012.12.18.19.51.48 (version=SSLv3 cipher=OTHER); Tue, 18 Dec 2012 19:51:50 -0800 (PST) Message-ID: <50D139D3.2010604@rdtan.net> Date: Wed, 19 Dec 2012 11:51:47 +0800 From: Edward User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Eitan Adler Subject: Re: [RFC] Q&A propose to add into FAQ References: <50CF471D.10407@rdtan.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQnPdSdkPNjPWW1YCVpR4Z1NiYIads8cE7oTzoThQ1YADXK91aiFUWgP1TL//fQp00QvFgwt Cc: Edward , freebsd-doc@freebsd.org X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2012 03:58:59 -0000 Hi Eitan, On 12/18/12 3:14 AM, Eitan Adler wrote: > Lets focus on content and language first. The next step is turning > this into docbook. I'll be happy to do that once we nail the > language. > > I might write these like. I'm largely basing the content on what you > wrote with some editorial changes. I'll answer your questions here and list the updated of the content afterwards. > Q4: I just started a service, how do I figure out what TCP/UDP port it > is listening on? > A4: Use the utility "sockstat". Usage example, > "sockstat -Ptcp" > "sockstat -Pudp" > > ** maybe expand a bit more on this Done and it's updated at the bottom. > Q7: My server performance seems to be slow. How can I find out what > the bottleneck is? > A7: Use iostat(1). For example, "iostat -dw2" displays > device (-d) statistic refreshing the output every 2 second (-w2). > "iostat -Cw2" displaya CPU (-C) statistic. > > ** also mention sysstat here? Thanks for the tip and the utility systat is very useful tool to monitor system states interactively. I've included some "unjust" mentions in it (A7) but avoided a too lengthy introduction. As I thought Q&A should not be too long to read. But please do correct me if I'm wrong. > Q8: FreeBSD seems to be rejecting connections because > of too many TCP connections in the "TIME_WAIT" state. > How can I reduce the timeout? > > ** I can't comment on the answer specifics here. Seems okay though > can do with a bit of English editing I've done some cosmetic changes to the answer (A8) and wait for any advise & changes needed. > Q9: I just changed /etc/newsyslog.conf. How can I check if it does > what I expect? > ... Done and it's updated at the bottom. > Q10: The output of "ps" is truncated to the end of my terminal width and > I can't see the program name. > > ** I'm not sure I'd make this an FAQ. Is this commonly asked? I thought it would be helpful because most of the admins around me seems to be bother by this and opt to adjust the terminal width big enough to accommodate "ps" output. But rather, "ps" output can be set to disregard the terminal width. But then, I'm fine if this is excluded :) >> By the way, do you guys think is there any chance that this Q&A can >> squeeze into the FAQ? > > I have no objections... > I'll update the sequence of the Q&A number 10 by replacing it with this. Here's the updated version : Q1: Boot messages are missing from dmesg. Where can I find them? A1: Kernel log messages are recorded in /var/log/messages, /var/log/dmesg.yesterday, and /var/log/dmesg.today. Boot time messages are recorded in /var/run/dmesg.boot. Q2: I have some software which only works on very old versions of FreeBSD, where can I get these? A2: Older versions of FreeBSD can be obtained from ftp://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/. Most of these versions are past End of Life and can be extremely buggy or insecure, use at your own risk. Q3: I have a piece of software that runs only on 64 bit processor. How do I know my current processor is capable of 64 bit processing? A3: Look at /var/run/dmesg.boot, search for the line with "AMD Features". If CPU features flag "LM" is present, the processor supports 64 bit processing. Otherwise, it is likely to be a 32 bit processor. Here is an example of a 64 bit processor: AMD Features=0x28100000 Q4: I just started a service, how do I figure out what TCP/UDP port it is listening on? A4: Use the utility "sockstat" to list open/listening ports. Here is an example of listing TCP ports "sockstat -Ptcp". To list UDP ports instead, execute "sockstat -Pudp". Q5: My time is wrong, how can I change the timezone? A5: Use "tzsetup" utility. Q6: I'm troubleshooting a network link issue, how can I generate big size file to test network transfer speed? A6: Use the utility "dd". For example, "dd if=/dev/random of=hugefile.txt bs=1m count=1k" would create a file called hugefile.txt with the size of 1GB. Q7: My server performance seems to be slow. How can I find out what the bottleneck is? A7: Use iostat(1). For example, "iostat -dw2" displays device (-d) statistic refreshing the output every 2 second (-w2). "iostat -Cw2" displaya CPU (-C) statistic. Also, "systat" is another interactive tool to monitor system statistics. Its operation are similar to "vim" behavior. Check out "systat" man page for more info. Q8: FreeBSD seems to be rejecting connections because of too many TCP connections in the "TIME_WAIT" state. How can I reduce the timeout? A8: In short, tune the sysctl value "net.inet.tcp.msl" to something modern and acceptable, such as 7500. In detail, the default timeout value for TIME_WAIT status is set to 60 seconds. This value is based on RFC 793. Since this RFC is drafted in year 1981, equipments and bandwidth of that time was not as fast as what we have now. A 60 seconds of waiting for TCP session to terminate, is a long time. For a busy server opening and closing TCP connections, this value should set to a shorter time, such as 15 seconds. The value of "net.inet.tcp.msl" is not the usual "literal" seconds though. In order to reduce from the default 60 seconds to 15 seconds, firstly, convert it to milliseconds. Then divide it by 2. For example, when 15 seconds is converted to 15,000 milliseconds, it then should be divided by 2, which sums up to "7500". This will be the value for "net.inet.tcp.msl", which equivalent to 15 seconds. Q9: I just changed /etc/newsyslog.conf. How can I check if it does what I expect? A9: Use the parameter "-nvv" when executing "newsyslog". For example, "newsyslog -nvv" would tell what are each of the lines in /etc/newsyslog.conf would do when the time comes. Q10: My this colleague/friend sits at the computer too much, how can I punk her? A10: Install "games/sl" and then wait for her to mistype "sl" for "ls". Your comments is much appreciated and glad to get more :) Regards, Edward.