Is it normal to be connected only with a few peers (1 to 4, more often 1 than 4)? I think with such a low number of peers, there are security issues. If it is not, is there any way to increase this number? I am running geth --syncmode "light" because of RAM issues so perhaps it may be related?
That seems low for your normal number of peers. I've encountered low peer counts in the past (with
geth versions less than or equal to 1.4.13; I use Parity now) and they've been due to
- incorrectly synchronized clock (not so far off as to be cut off from the network, but bad enough to have fewer peers);
- attempting to have too many peers relative to my network connection (resolved by running
gethin the cloud and adding it as a static peer in my local node and vice versa; to make this possible, my local node had a static address via a VPN shared with the cloud node; also, reducing
- firewalls (specifically, blocked inbound connections);
- outdated peers/nodes list (resolved by renaming/deleting the list directory; IIRC, this is the
- my use of a statically added peer.
Your guess about RAM may be correct since the proximal cause may be the same as the #2 reason I have above: my hypothesis was that my node was timing out before completing a handshake/etc. For some of these things, you can check to see if your client is making and breaking a lot of connections to peers.
I found Parity to be much more capable of maintaining a high peer count.