Is 4 GB Ram with 2 core Intel(R) Xeon(R) Platinum 8168 CPU @ 2.70GHz enough for 30-40 players? with 2 worlds
Yes, but it depends on what you'll be using your server for. Factions/Survival There will be a lot of chunks being generated. So in the worst case, players will need to wait for a few seconds before the chunk generates. The async-chunk-io branch (in-dev) should make it not soo much of a problem. Creative Again, same thing as factions. Unless you are using a custom generation plugin (for creative plot grids). Unlike the normal generator, there is zero randomness and a static generating structure so chunk generation shouldn't be a problem. 30-40 players easy. Minigames/Hub In this case you wont need to generate new chunks at all. So that's a huge bonus. I've always hosted and still host minigames and hub on the same system with the following specs: 2 vCores, 2.4GHz, 8GB RAM and 40 GB SSD. I never got a good amount of players on the hub but the minigames has once had 60 players and the server would still be processing on ~20 TPS. For the factions/survival and creative, I'm ignoring all the services running on your system and server plugins. A side-note about the Minigames/Hub server: The system has only MySQL running (aside from the pre-installed services). The minigames server doesn't load and unload worlds on runtime and players dont spawn to players that aren't in the same game session. All chunks are pre-loaded and cached on startup. That could be why it's capable of hosting that many players.
actually i just want to make pvp & economy (30-50 MB map) server with 1 mcpe server / server and mysql in other server
2.7Ghz aren't much for PM though, but it should be fast enough for pvp, provided plugins are well written.