I am planning to deploy some CentOS linux servers and I've read many articles that suggested to disabled root account. I am just wondering is that necessary? If not, what's the best security policy?
Mickey Shine's questions
I have a server running well before but today I can not ssh to it, it shows me:
ssh: connect to host 10.0.0.117 port 22: Connection refused
I guess something is wrong with it but I can not log onto it so what can I do at this situation, at least to figure out what's the problem with it?
I was benchmarking my site with apache ab and I noticed that the response time had big differences when running ab on the server and running ab on a client box remotely.
So what's the biggest difference between running ab on the server and running ab remotely. Is the time consumed on net transportation?
Are there some open source websocket server implementations, especially ready for production? (Are there Erlang based out there?)
I got the following errors from system log (/var/log/messages). what they indicate? And how to solve them?
Sep 30 05:19:35 node23 kernel: Mem-info:
Sep 30 05:19:35 node23 kernel: Node 0 DMA per-cpu:
Sep 30 05:19:35 node23 kernel: cpu 0 hot: high 0, batch 1 used:0
Sep 30 05:19:35 node23 kernel: cpu 0 cold: high 0, batch 1 used:0
Sep 30 05:19:35 node23 kernel: cpu 1 hot: high 0, batch 1 used:0
Sep 30 05:19:35 node23 kernel: cpu 1 cold: high 0, batch 1 used:0
Sep 30 05:19:35 node23 kernel: cpu 2 hot: high 0, batch 1 used:0
Sep 30 05:19:35 node23 kernel: cpu 2 cold: high 0, batch 1 used:0
Sep 30 05:19:35 node23 kernel: cpu 3 hot: high 0, batch 1 used:0
Sep 30 05:19:35 node23 kernel: cpu 3 cold: high 0, batch 1 used:0
Sep 30 05:19:35 node23 kernel: Node 0 DMA32 per-cpu:
Sep 30 05:19:35 node23 kernel: cpu 0 hot: high 186, batch 31 used:64
Sep 30 05:19:35 node23 kernel: cpu 0 cold: high 62, batch 15 used:47
Sep 30 05:19:35 node23 kernel: cpu 1 hot: high 186, batch 31 used:52
Sep 30 05:19:35 node23 kernel: cpu 1 cold: high 62, batch 15 used:50
Sep 30 05:19:35 node23 kernel: cpu 2 hot: high 186, batch 31 used:76
Sep 30 05:19:35 node23 kernel: cpu 2 cold: high 62, batch 15 used:23
Sep 30 05:19:35 node23 kernel: cpu 3 hot: high 186, batch 31 used:116
Sep 30 05:19:35 node23 kernel: cpu 3 cold: high 62, batch 15 used:50
Sep 30 05:19:35 node23 kernel: Node 0 Normal per-cpu:
Sep 30 05:19:35 node23 kernel: cpu 0 hot: high 186, batch 31 used:12
Sep 30 05:19:35 node23 kernel: cpu 0 cold: high 62, batch 15 used:15
Sep 30 05:19:35 node23 kernel: cpu 1 hot: high 186, batch 31 used:7
Sep 30 05:19:35 node23 kernel: cpu 1 cold: high 62, batch 15 used:24
Sep 30 05:19:35 node23 kernel: cpu 2 hot: high 186, batch 31 used:93
Sep 30 05:19:35 node23 kernel: cpu 2 cold: high 62, batch 15 used:9
Sep 30 05:19:35 node23 kernel: cpu 3 hot: high 186, batch 31 used:30
Sep 30 05:19:35 node23 kernel: cpu 3 cold: high 62, batch 15 used:47
Sep 30 05:19:35 node23 kernel: Node 0 HighMem per-cpu: empty
Sep 30 05:19:35 node23 kernel: Free pages: 68484kB (0kB HighMem)
Sep 30 05:19:35 node23 kernel: Active:3469506 inactive:0 dirty:0 writeback:0 unstable:0 free:17121 slab:19849 mapped-file:3469691 mapped-anon:3 pagetables:7393
Sep 30 05:19:35 node23 kernel: Node 0 DMA free:11064kB min:8kB low:8kB high:12kB active:0kB inactive:0kB present:10672kB pages_scanned:0 all_unreclaimable? yes
Sep 30 05:19:35 node23 kernel: lowmem_reserve[]: 0 3254 13859 13859
Sep 30 05:19:35 node23 kernel: Node 0 DMA32 free:45932kB min:3536kB low:4420kB high:5304kB active:3209680kB inactive:0kB present:3332896kB pages_scanned:21228488 all_unreclaimable? yes
Sep 30 05:19:35 node23 kernel: lowmem_reserve[]: 0 0 10605 10605
Sep 30 05:19:35 node23 kernel: Node 0 Normal free:11488kB min:11520kB low:14400kB high:17280kB active:10668472kB inactive:0kB present:10859520kB pages_scanned:22327217 all_unreclaimable? yes
Sep 30 05:19:35 node23 kernel: lowmem_reserve[]: 0 0 0 0
Sep 30 05:19:35 node23 kernel: Node 0 HighMem free:0kB min:128kB low:128kB high:128kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no
Sep 30 05:19:35 node23 kernel: lowmem_reserve[]: 0 0 0 0
Sep 30 05:19:35 node23 kernel: Node 0 DMA: 4*4kB 5*8kB 2*16kB 5*32kB 5*64kB 2*128kB 2*256kB 1*512kB 1*1024kB 0*2048kB 2*4096kB = 11064kB
Sep 30 05:19:35 node23 kernel: Node 0 DMA32: 1*4kB 13*8kB 0*16kB 2*32kB 1*64kB 1*128kB 0*256kB 1*512kB 0*1024kB 0*2048kB 11*4096kB = 45932kB
Sep 30 05:19:35 node23 kernel: Node 0 Normal: 16*4kB 2*8kB 1*16kB 0*32kB 0*64kB 1*128kB 0*256kB 0*512kB 1*1024kB 1*2048kB 2*4096kB = 11488kB
Sep 30 05:19:35 node23 kernel: Node 0 HighMem: empty
Sep 30 05:19:35 node23 kernel: 3469855 pagecache pages
Sep 30 05:19:35 node23 kernel: Swap cache: add 246644, delete 246644, find 60830/64691, race 0+6
Sep 30 05:19:35 node23 kernel: Free swap = 9933620kB
Sep 30 05:19:35 node23 kernel: Total swap = 9976356kB
Sep 30 05:19:35 node23 kernel: Free swap: 9933620kB
Sep 30 05:19:35 node23 kernel: 3801088 pages of RAM
Sep 30 05:19:35 node23 kernel: 272953 reserved pages
Sep 30 05:19:35 node23 kernel: 3470343 pages shared
Sep 30 05:19:35 node23 kernel: 0 pages swap cached
Sep 30 05:19:35 node23 kernel: Out of memory: Killed process 2715 (dbus-daemon).
Sep 30 05:19:35 node23 kernel: irqbalance invoked oom-killer: gfp_mask=0x280d2, order=0, oomkilladj=0
But we didn't use any persistent connections. Why are there many idle connections? We noticed that by using 'show processlist' command and the time was about 4000-8000 seconds. Those connections looked like always 'sleep'. We're using Nginx with PHP in fast-cgi mode, and we use PDO library. Any suggestions?
We're using Nginx + PHP in fastcgi mode, and using PHP-FPM as cgi process manager. In our scripts we use PDO to connect MySQL and definitely NOT in persistent mode.
But recently we found we still got too many connections in MySQL, any suggestions (or any possible reasons)?
I am looking for a solution to load balancing and failover strategy, mainly for big web applications. We have many services to be balanced, such as web, MySQL, and many other HTTP or TCP based services. But I am not sure what their pros and cons are, and which I should choose.
Possible Duplicate:
I am looking for a good load balancing (or reverse proxy) software for TCP and HTTP, any suggestions?
I am looking for a good load balancing (or reverse proxy) software for TCP and HTTP, any suggestions?
Take a look at this list http://en.wikipedia.org/wiki/List_of_file_systems#Distributed_parallel_fault-tolerant_file_systems
and which is the best choice for storing large number of static media files (with normal file size: 10KB-2M for images, and 5M-500M for video files) of a website? (among these distributed parallel fault tolerant file systems)
I heard of some distributed file systems like Gluster and Moose. Are there any better ideas out there that I am not aware of?
Updated:
================================================================ I finally found the reason with oprofile. It was because the routing cache of Symfony. We have lots of pages with different urls and symfony caches them in one file (serialized data). So the cache file grows large and it needs more CPU to serialize and unserialize data.
Everything went well after I disabled the routing cache
================================================================
Recently I updated my PHP program on my web server (Centos 5.3 + PHP 5.2.6), but it puts a heavy load on my server. So I decided to use oprofile to find what makes my server slow.
I've successfully installed oprofile but what's next? Does anyone have practical experience tuning an apache server?
Thanks~
Updated:
================================================================ I finally found the reason with oprofile. It was because the routing cache of Symfony. We have lots of pages with different urls and symfony caches them in one file (serialized data). So the cache file grows large and it needs more CPU to serialize and unserialize data.
Everything went well after I disabled the routing cache
================================================================
We have three web servers with LVS (Apache 2.11 + PHP 5.26), and we use Symfony 1.0 for our products development.
But recently we have updated our products with Symfony 1.2.7 and we got a critical performance issue.
We use Ganglia to monitor our servers. Before the updates, the average load of web servers is under 1. After the updates, the load increases dramatically with load 80 at top (I can see CPU usage increases much from Ganglia).
I can't find the reasons. Is it because the Symfony framework? (But according to Ganglia, the load shouldn't increase so rapidly).
By the way, in our new products lots of AJAX are used, which means there are at least 5-7 PHP requests to open one page. Is this the reason?
Can anyone help me to find all the possible reasons? Or what else information should I offer to diagnose?
Thanks in advance and looking forward to your reply~
I have a server running on CentOS 5.3 (a comet chat server, will have lots of tcp connections). Recently I found it was very slow (http service and ssh) so I use "ifconfig" command to figured out what happened.
eth0 Link encap:Ethernet HWaddr 00:1C:C0:B5:D5:EA
inet addr:10.0.0.61 Bcast:10.0.0.255 Mask:255.255.255.0
inet6 addr: fe80::21c:c0ff:feb5:d5ea/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:871861 errors:0 dropped:489662344145 overruns:0 frame:0
TX packets:639044 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:207239658 (197.6 MiB) TX bytes:169416201 (161.5 MiB)
Interrupt:225 Base address:0x6000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:44497 errors:0 dropped:0 overruns:0 frame:0
TX packets:44497 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:11470951 (10.9 MiB) TX bytes:11470951 (10.9 MiB)
When I restart its network, all goes well. But after a period of time it will be slow again.
Can someone help?
Updated:
================================================================================
As Rajat requested, I wlll post some information for diagnosing
uname -a
Linux im.cluster.myserver.com 2.6.18-128.el5 #1 SMP Wed Jan 21 10:41:14 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
sudo /sbin/lspci | grep Ethernet
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 03)
sudo dmesg | grep eth0
eth0: RTL8168d/8111d at 0xffffc20000006000, 00:1c:c0:b5:d5:ea, XID 281000c0 IRQ 225
r8169: eth0: link up
r8169: eth0: link up
eth0: no IPv6 routers present
r8169: eth0: link up
eth0: no IPv6 routers present
sudo /sbin/ethtool eth0
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: MII
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: p
Current message level: 0x00000033 (51)
Link detected: yes
sudo /sbin/ethtool -k eth0
Offload parameters for eth0:
Cannot get device udp large send offload settings: Operation not supported
rx-checksumming: on
tx-checksumming: off
scatter-gather: off
tcp segmentation offload: off
udp fragmentation offload: off
generic segmentation offload: off
sudo /sbin/ethtool -S eth0
NIC statistics:
tx_packets: 4483119
rx_packets: 7443820
tx_errors: 0
rx_errors: 0
rx_missed: 0
align_errors: 0
tx_single_collisions: 0
tx_multi_collisions: 0
unicast: 3591906
broadcast: 442720
multicast: 3851914
tx_aborted: 0
tx_underrun: 0
It's a big question:) We are running a website with LAMP that is not big, 5 web servers with LVS load balancing, 3 MySQL servers with replications and separation of reading and writing, and we use Memcached for caching and some full-text searching tools. So far it works well because we do not have a large traffic for the moment.
But when the users are growing rapidly, we will have to scale our architecture to satisfy the needs. Maybe distributed file system and database (and parallel computing?) will be introduced, and also some techniques for clustering and maintenance (like Gearman and Pshell).
There are some articles on the net that I can go through with. But I really need some practical experiences to prepare for this issue feasibly and efficiently .