Welcome Guest, Not a member yet? Register   Sign In
Can CI 4 handle a thousand request?
#1

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?
"The capacity to learn is a gift, the ability to learn is a skill, but the willingness to learn is a choice."
Reply
#2

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.
Reply
#3

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.
Reply
#4

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
Reply
#5

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.
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
Reply
#6

Thanks for your amazing reply to my questions. I think it solved my question.
"The capacity to learn is a gift, the ability to learn is a skill, but the willingness to learn is a choice."
Reply
#7

(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.
Reply
#8

(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.
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply
#9

(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.
pro novice
Reply
#10

(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
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB