Sizing will depend on the details of your environment. Generally I would recommend that you experiment with real workloads (or a simulation thereof), using an approach such as described at Quantitative Cluster Sizing | Elastic
Typically we recommend that clusters have three master-eligible nodes so that if one of the nodes fails then the other two can still safely form a quorum and make progress. If a cluster has fewer than three master-eligible nodes, then it cannot safely tolerate the loss of any of them. Conversely if a cluster has many more than three master-eligible nodes, then elections and cluster state updates can take longer.
The rest depends on:
how capable the hardware is
how much data you're sending to APM Server and Elasticsearch (how many events/sec)
how many end-users will be accessing Kibana
desired fault tolerance
Side note: if you only have 2 data nodes then that doesn't leave a lot of room for failure. If you haven't already, consider also using snapshot and restore, for backing up data to slower network/cloud storage.
We will conisder these points, I guess what I was looking for is , what different service I can co host in a machine (lets say my machine is powerful enough to host 2 services given our load)
Excluding data nodes, I was thinking of co-hosting
Master + Ingestor
APM + Kibana
Coordinator as separte
Will it cause any problems or do you see any red flags?
If you have the hardware available, then I would say it's generally a good idea to have dedicated master-eligible nodes. Under Node | Elasticsearch Guide [8.11] | Elastic there's some discussion of why it may be a good idea to run dedicated master-eligible nodes.
One clarification , everywhere it is suggested that have 50% of system memory allocated to JVM for elastic search. Any specific reason for this number 50% , any issue if we go lets says 70% mem.
I don't know where the 50% number comes from. I recommend opening a new topic at https://discuss.elastic.co/c/elastic-stack/81 if you would like more details on running Elasticsearch.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.