CodeIgniter Forums
Can CI 4 handle a thousand request? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forum-9.html)
+--- Thread: Can CI 4 handle a thousand request? (/thread-75673.html)



Can CI 4 handle a thousand request? - taliffsss - 03-03-2020

I'm just wondering if CI4 can handle a thousand requests. because in PHP Framework benchmark CI has no data to show, can CI4 compete to laravel in terms of faster?


RE: Can CI 4 handle a thousand request? - kilishan - 03-03-2020

Yes. It's a new framework and hasn't been field tested like the others have, but should not be a problem at all. It's really up to how you program, making sure you do efficient queries, caching where needed, and, probably most importantly, have a server that helps it hit 1000 simultaneous connections.


RE: Can CI 4 handle a thousand request? - jreklund - 03-03-2020

And on top of CodeIgniter you should have a server based cache server like Varnish (or do it in Nginx). For all the guest users.


RE: Can CI 4 handle a thousand request? - zahhar - 03-04-2020

Your question has 2 parts:

Part one, "if CI4 can handle a thousand requests", depends if you mean thousand requests per second, per minute or per day? Wink Seriously, with 1000req/sec your bottleneck will be not CI4, but underlying hardware, its file system, and your database engine. With such load you should design your application appropriately, employ load balancer, caching on different levels (client-side, server-side, database), ensure indexes in DB tables are optimized for queries you run, use latest PHP7.x version with correct webserver config and many more. Raw CI4 performance is just one tiny part of your high-load ready infrastructure.

Part two, "can CI4 compete to laravel in terms of faster" is easier to answer: any framework can compete with any other framework that is using same programming language, world is open for competition and it is welcomed Smile Sariously again, there are several attempts to benchmark different PHP frameworks, most recent one is here: https://kinsta.com/blog/php-benchmarks/

Results were:
- CodeIgniter 4.0-rc.3 PHP 7.4 benchmark results: 333.08 req/sec
- Laravel 6.7.0 PHP 7.4 benchmark results: 394.96 req/sec

So they are close, but even without any business logic implemented pure synthetic tests shows results far beyound your target 1000req/sec. So even with Laravel you will be in troubles when face such load. So brace yourself Wink


RE: Can CI 4 handle a thousand request? - albertleao - 03-04-2020

It's 100% about the code you write and not Codeigniter. If you write bad code that is slow, it doesn't matter what framework you're using, it'll be slow. If you write good clean code, you can be on laravel, symfony, codeigniter or anything and serve hundreds of thousands or even millions of requests depending on your servers.


RE: Can CI 4 handle a thousand request? - taliffsss - 03-04-2020

Thanks for your amazing reply to my questions. I think it solved my question.


RE: Can CI 4 handle a thousand request? - nonebeliever - 03-08-2020

(03-04-2020, 08:07 AM)albertleao Wrote: It's 100% about the code you write and not Codeigniter. If you write bad code that is slow, it doesn't matter what framework you're using, it'll be slow. If you write good clean code, you can be on laravel, symfony, codeigniter or anything and serve hundreds of thousands or even millions of requests depending on your servers.

I disagree. Its all about the infrastructure. Supporting hundreds, thousands, millions of users has little to do with "clean code". Supporting a few hundred users is very different from supporting millions.


RE: Can CI 4 handle a thousand request? - includebeer - 03-08-2020

(03-08-2020, 04:18 AM)nonebeliever Wrote:
(03-04-2020, 08:07 AM)albertleao Wrote: It's 100% about the code you write and not Codeigniter. If you write bad code that is slow, it doesn't matter what framework you're using, it'll be slow. If you write good clean code, you can be on laravel, symfony, codeigniter or anything and serve hundreds of thousands or even millions of requests depending on your servers.

I disagree. Its all about the infrastructure. Supporting hundreds, thousands, millions of users has little to do with "clean code". Supporting a few hundred users is very different from supporting millions.

Slow database requests is almost always the reason a site is slow. There’s a lot to take into consideration when dealing with a lot of traffic.


RE: Can CI 4 handle a thousand request? - tweenietomatoes - 03-08-2020

(03-04-2020, 08:07 AM)albertleao Wrote: It's 100% about the code you write and not Codeigniter. If you write bad code that is slow, it doesn't matter what framework you're using, it'll be slow. If you write good clean code, you can be on laravel, symfony, codeigniter or anything and serve hundreds of thousands or even millions of requests depending on your servers.

But you can serve more request on same hardware with other programming languages or php implementations such as php-pm, swoole or workerman.

even 15x - 50x times more requests.


RE: Can CI 4 handle a thousand request? - albertleao - 03-09-2020

(03-08-2020, 10:57 AM)tweenietomatoes Wrote:
(03-04-2020, 08:07 AM)albertleao Wrote: It's 100% about the code you write and not Codeigniter. If you write bad code that is slow, it doesn't matter what framework you're using, it'll be slow. If you write good clean code, you can be on laravel, symfony, codeigniter or anything and serve hundreds of thousands or even millions of requests depending on your servers.

But you can serve more request on same hardware with other programming languages or php implementations such as php-pm, swoole or workerman.

even 15x - 50x times more requests.


You are absolutely correct, but this question was about CI