@abdulbazith Well you need to find the bottleneck. With that much traffic, I imagine it’s your database. Out of the box, something like MySQL can only handle so many concurrent connections. So look to see if it is indeed the number of allowed connections being exhausted and look to optimise and/or scale your database.
My laravel application cant handle 1000 users simultaneously. site cant be reached error when trying to login simultaneously
Guys iam working with laravel project. its a online examination application.
first i have hosted my application in shared hosting. simultaneously 700 students wrote the exam well. past june month full the exam conducted daily. daily 700 students will write exam. everything went fine.
3 days back the school had added further 500 students. now the strength is 1200 students. so we opted to vps server. 4 gb ram and 1 TB hard disk. when all the 1200 students simultaneously tried to login the application yesterday. none of the student cant reach the site.
it showed error
Site cant be reached .
xyz.com took too long to respond
ERR_CONNECTION_TIMED_OUT
so we opted to dedicated server. the configuration is
CPU: Intel Xeon Processor E3-1271 v3
RAM: 30GB DDR3 RAM
HDD: 2TB HDDx2 RAID 1
Bandwidth: 2 TB
but today student started the same process once again the same problem occured. site cant be reached error.
when i chatted with my support what they said is to optimize the application.
let me explain my configuration first.
my laravel version
Laravel Framework 6.18.0
my project folder inside the server is 150 mb only but images are stored in the storage folder. it takes 600mb (zip format). all the question and answers have example image. so image size is 600mb (in zip state). if i unzip it , then it takes 1 gb above
My DB size image: https://imgur.com/MY84uiV
my db size is : 50 mb with 443231 total rows and 23 tables. and engine is innoDB
What i did to optimize my project is
Route::get('/cc', function () {
Artisan::call('cache:clear');
echo '<script>alert("cache clear Success")</script>';
});
Route::get('/ccc', function () {
Artisan::call('config:cache');
echo '<script>alert("config cache Success")</script>';
});
Route::get('/vc', function () {
Artisan::call('view:clear');
echo '<script>alert("view clear Success")</script>';
});
Route::get('/cr', function () {
Artisan::call('route:cache');
echo '<script>alert("route clear Success")</script>';
});
Route::get('/coc', function () {
Artisan::call('config:clear');
echo '<script>alert("config clear Success")</script>';
});
Route::get('/storage123', function () {
Artisan::call('storage:link');
echo '<script>alert("linked")</script>';
});
so ```xxz.com/cc`` if i give like this cache will be cleared. like that i will give.
other than that i used eloquent queries in all controller. i didnt use any raw queries.
But even in this dedicated server 500 students cant access it why?? is there anything to do.
few of my friends said to change the db engine from innoDB to mariaDB so that it follows many request is that correct?? do i need to do that??
or else do i need to make the login process some what different by sequential request??
but 5 days back in shared hosting 700 students attended the exam well.
iam unable to predict whats happening?? kindly some one help please.
i didnt done any testing.. what kind of testing i should do?? for that testing what should i do?
most of them said to regulate the concurrent user. but how to do that??
my server team said that, the y increased our appache limit to 1000 and execution process to 1000. but these all i didnt do in shared hosting.
i dont know what to do kindly some one suggest all your ideas please.
Please or to participate in this conversation.