Currently, e-learning is one of the most prevalent educational methods because of its need in today's world. Virtual classrooms and web-based learning are becoming the new method of teaching remotely. The students experience a lack of access to resources commonly the educational material. In remote locations, educational institutions face significant challenges in accessing various web-based materials due to bandwidth and network infrastructure limitations. The objective of this study is to demonstrate an optimization and queueing technique for allocating optimal servers and slots for users to access cloud-based elearning applications. The proposed method provides the optimization and queueing algorithm for multi-server and multi-city constraints and considers where to locate the best servers. For optimal server selection, the Rider Optimization Algorithm (ROA) is utilized. A performance analysis based on time, memory and delay was carried out for the proposed methodology in comparison with the existing techniques. The proposed Rider Optimization Algorithm is compared to Particle Swarm Optimization (PSO), Genetic Algorithm (GA) and Firefly Algorithm (FFA), the proposed method is more suitable and effective because the other three algorithms drop in local optima and are only suitable for small numbers of user requests. Thus the proposed method outweighs the conventional techniques by its enhanced performance over them.