From owner-freebsd-doc@FreeBSD.ORG Mon Dec 17 16:24:41 2012 Return-Path: Delivered-To: doc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 05D8E69B for ; Mon, 17 Dec 2012 16:24:41 +0000 (UTC) (envelope-from edward@rdtan.net) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx1.freebsd.org (Postfix) with ESMTP id C59B08FC0C for ; Mon, 17 Dec 2012 16:24:40 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id bi5so3703888pad.13 for ; Mon, 17 Dec 2012 08:24:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=kVEE7LpbjXRLS/vBjY1aQcD4ao/c+Bi+BlHxCARnFfs=; b=KQnTJgTPz8e08z9X5XZ3yzw5q7A8mKBFLJad98e8N3whTXg6+UFO7Qp7EZzjgrhGKn o9KRTiTsdvf/Txmiu6vZ4BcZZDacaJxPSgWjORsEMnYd2mq/e3MbqKt7BxQaIdwO8d0q e6SOSAEd6KQobQ88bUa/Ea6Z+Jmj39WCeRumDVLicyJhIUHIq/Kc+8zQa3MiI+llbfcj FQyLW1u3lK112OxzVq/gmGZhLNKyXZvXTxBXC+ri+s3bXmw5LIHn/kHmz+vk34xo0D0x CFxf/xnjxqAJ09s+TghTF7EdMMDagT7nUIryL+MnzHgo2NUDbX934q3wwDLb+MYtZL+l Xi9w== Received: by 10.68.227.73 with SMTP id ry9mr44398998pbc.73.1355761480155; Mon, 17 Dec 2012 08:24:40 -0800 (PST) Received: from zion.local ([203.82.92.37]) by mx.google.com with ESMTPS id hs2sm8432079pbc.22.2012.12.17.08.24.36 (version=SSLv3 cipher=OTHER); Mon, 17 Dec 2012 08:24:39 -0800 (PST) Message-ID: <50CF471D.10407@rdtan.net> Date: Tue, 18 Dec 2012 00:23:57 +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: doc@freebsd.org Subject: [RFC] Q&A propose to add into FAQ Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQm9nEARX11W1I1V84T1t8zLjb9jHUROkpjvQknZNiTG785ubeUiPQqO37ETwnxjWJm81VOc 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: Mon, 17 Dec 2012 16:24:41 -0000 Hi, I wish to submit the below list of Q&A (Question & Answer) for addition to current FreeBSD FAQ book. Before this can happen, I would like to seek your comments & suggestion whether these Q&A are in correct facts, writing style and/or suitable. These Q&A are : Q1: Boot up messages are missing from /var/log files. Where can I find them? A1: Kernel log messages are recorded in /var/log/messages, /var/log/dmesg.yesterday, and /var/log/dmesg.today. But boot time messages can be found at /var/run/dmesg.boot. Q2: My xxx software only works on "some old version" of FreeBSD, where can I get these? A2: Older versions of FreeBSD can be obtain from ftp://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/ . You should be aware that most of these versions are EoL (End of Life) and can be extremely buggy, 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: Take a look at /var/run/dmesg.boot, search for the line with "AMD Features". If CPU features flag "LM" exists, your processor supports 64 bit processing. Otherwise, you are most likely to be using a 32 bit processor. Example of log to look for (64 bit processor) : AMD Features=0x28100000 Q4: I just started "xxx" service, how to find out what TCP/UDP port is open/listening? A4: Use the utility "sockstat". Usage example, "sockstat -Ptcp" "sockstat -Pudp" Q5: I'm living in "xxx" country, how can I change this server 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 named hugefile.txt with the size of 1 gigabyte. Q7: My server performance seems to be slow. How can I find out what's the bottleneck? A7: Use the utility "iostat". Example, "iostat -dw2" would display device (-d) statistic refreshing the output every 2 second (-w2). "iostat -Cw2" would display CPU (-C) statistic. Q8: This server of mine is a public DNS and it seems to be rejecting connections because of too many TCP connections with "TIME_WAIT" status (from "netstat -an"). 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 & bandwidth of that time wasn't 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 & closing TCP connections, this value should set to a fairly short 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, convert it to milliseconds and then divide it by 2. For example, when 15 seconds is converted to 15,000 milliseconds, it then should divide by 2, which sums up as "7500". This will be the value for "net.inet.tcp.msl". Q9: I just updated /etc/newsyslog.conf. How do I check for syntax error? 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: The output of "ps" is truncated to the end of my terminal width and I can't see the program name. A10: Tell "ps" to disregard your terminal width. For example, "ps auxww". By the way, do you guys think is there any chance that this Q&A can squeeze into the FAQ? Q: My this cute little colleague/friend have very big fat fingers, how can I punk him? A: install port "games/sl" then try typing "sl" instead of "ls". Regards, Edward.