Your missing one very important thing. With Swoole, that static variable/singleton is only shared between requests that are processed on the same thread.
This is quite scary to be honest >.< I'd love to try this in a real project but all the magic happening in the back is scary. Would you ecounter issue with sessions and redis and queues and other stuff ?
@@CaimAstraea on a 24 core server, you can have 24 threads, each with up to 10k coroutines doing IO stuff. This means potentially 240k connections to your database server. And if you have 10 servers, that's 2.4mill connections. So you need to add some buffering proxy on local host.
Video is great but a bit confusing as knowing what is returned at when is quite difficult. My question is if am saving from a form would octane return other previous request made or just the current one as it clones a new instance of the previously bootstrapped app
Perfect video Mohamed thank you! I have a question, I am running Octane with php artisan octane:start --watch, which is logging all requests in my console. How can I ignore certain requests to render? I am using Laravel Telescope which is spamming my console with logging requests
Uuuh, I live those deep diving videos, thanks a lot! Nice shot 'besides queues' SInce I got 7 queue workers running stable, I want to push everything to the queue ;-).
Hello Sir Thanks for your video i have replayed the video many times i succeed to install laravel octane but when it comes to check a route to make a redirection i'm lost
fantastic video! thanks!!! by the way would the services behave differently when they are resolved by deferrable providers? these kind of services may behave stateless even when they got manipulated in the boot method,right?
Deferred providers are all loaded when running on Octane. In other words, there's no deferred between deferred providers and regular providers on Octane.
In php-fpm, we can configure child processes count created. What about swoole-laravel? Does 1 instance process all requests? If my end point just dispatches a job (in mysql), is this should be in the same coroutine, or should it be dispatched?
@@themsaid Big existing project, many products depend on it and it will be annoying to port and lots of work for QA team. Anyway thank you for your answer :)
Great video Mohamed, I have a question. By using octane running on swoole we can easily run Jobs in the background and we won't use Supervisor anymore, right?
You need Supervisor to keep Octane running. And you still need it to keep your queue workers running as well. Octane isn't a replacement for queue workers.
@@themsaid thank you for the great video. Could you explain a little bit when we want to use queue workers vs Octane's concurrently method ? Is there a drawback of using concurrently in some cases ? Can we say that we use queues for tasks for which we don't need return information (ex. sending mail in background) ?
Thanks a lot Mohammed. But I wonder how its handle db connections on Octane with Swoole. Is there any connection pools for not to create a db connection for every request or every request is new db connection same as classic php fpm application?
Sorry but i would have a question using a multitenant app, specially with the tenancy provider configureRequest, so when swoole builds the app, cant find the tenant ti use cause logically is not getting any request, so my question is where is the best place to move that logic, and thanks a lot you are a hero
Well i created a global middleware that is in charge on configuring the tenant snd seems to work fine, i noticed that the initial memory used is like 23mb is it normal? And then for every request my memory goes up, so i guess i have a memory leak somewhere
Hello @mahmudul, have you complete multitenant app with seperated DBs ? And which package are used ? if Yes so please contact me twitter @DevDhruvJoshi ,
@@thedhruvjoshi I'm working on separate DB multi-tenant app. I don't use any package for it, i use my own package based on this channel multi-tenant video idea.
Hello Mohamed. I want to access singleton class in web app from Octane::tick . I understood both of them work different php instance. How to access it. If I don't access, could you develop swoole for this :)
Amazing video! I have one question regarding the adding to a static array. If only the container instance is cached and cloned, how come code that isn’t in the scope of the framework is affected by the stateful behavior?
This is a very informative video, But I am confused at 12:21, Can you please guide me on what should I do in this case: I have a `ThemeViewFinder` class that extends Laravel's `FileViewFinder`. ``` use Illuminate\View\FileViewFinder; class ThemeViewFinder extends FileViewFinder { } ``` And I am using the singleton in the service provider like this: ``` public function register() { $this->app->singleton('theme.finder', function ($app) { $themeFinder = new ThemeViewFinder( $app['files'], $app['config']['view.paths'] ); $themeFinder->setHints( $app->make('view')->getFinder()->getHints() ); return $themeFinder; }); } ``` Now, what modifications should I make here?
I didn't have any interest in Octane until now. Your videos are inspiring!
Very clear explanation. Thank You.
this is so informative video. thanks a lot Mohamed for sharing these awsome info
My pleasure :)
Awesome bro, i will try this, thanks for the info.
This video is fantastic! Thank you so much!!!
Glad you liked it :)
I want his chair... nice informative video too !
Thanks for watching! It's this one www.ikea.com/eg/en/p/jaervfjaellet-office-chair-glose-black-90363553/
Your missing one very important thing. With Swoole, that static variable/singleton is only shared between requests that are processed on the same thread.
You're definitely right. This is the key thing, if you do not know this will make you lose yourself while debugging.
Interesting, and what would cause a process to run on another thread?
This is quite scary to be honest >.< I'd love to try this in a real project but all the magic happening in the back is scary. Would you ecounter issue with sessions and redis and queues and other stuff ?
@@CaimAstraea on a 24 core server, you can have 24 threads, each with up to 10k coroutines doing IO stuff. This means potentially 240k connections to your database server. And if you have 10 servers, that's 2.4mill connections.
So you need to add some buffering proxy on local host.
Video is great but a bit confusing as knowing what is returned at when is quite difficult. My question is if am saving from a form would octane return other previous request made or just the current one as it clones a new instance of the previously bootstrapped app
Perfect video Mohamed thank you! I have a question, I am running Octane with php artisan octane:start --watch, which is logging all requests in my console. How can I ignore certain requests to render? I am using Laravel Telescope which is spamming my console with logging requests
Uuuh, I live those deep diving videos, thanks a lot!
Nice shot 'besides queues' SInce I got 7 queue workers running stable, I want to push everything to the queue ;-).
Queues are GREAT!
Thanks for sharing
Thnks a lot
Thank you
Question :i sit production ready.
Will any packages cause problems
Very Goood video.
Thanks, very much! I always wanted to use swoole, but I was afraid of the statefulness of the app.
thanks a lot!
You're welcome :)
Hello Sir
Thanks for your video
i have replayed the video many times
i succeed to install laravel octane
but when it comes to check a route to make a redirection i'm lost
الله ينور عليك
What's the reason for creating a fresh instance on each request? What would be the disadvantages of reusing the original instance as Node.js does?
To avoid mutations passing from one request to another. Not all PHP libraries and packages are ready for stateful yet.
fantastic video! thanks!!! by the way would the services behave differently when they are resolved by deferrable providers? these kind of services may behave stateless even when they got manipulated in the boot method,right?
Deferred providers are all loaded when running on Octane. In other words, there's no deferred between deferred providers and regular providers on Octane.
@@themsaid Thanks for your share! learned something new
in the async DB queries what will happen when the workers are full?, will it wait until they are free or run as usual sequence DB queries ?
If all workers are busy, Swoole will wait until they're available.
In php-fpm, we can configure child processes count created. What about swoole-laravel? Does 1 instance process all requests?
If my end point just dispatches a job (in mysql), is this should be in the same coroutine, or should it be dispatched?
which one is faster app->singletone or app->bind?
Thnx man, great video. Do u know when octane will be available for Lumen ?
I don't think it will ever be. Use Laravel :) Much faster and more powerful
@@themsaid Big existing project, many products depend on it and it will be annoying to port and lots of work for QA team. Anyway thank you for your answer :)
@@themsaid Why should i use lumen then if laravel is faster ?
@@HishamElsayad You shouldn't, that's the point. There is basically no advantages to using Lumen anymore.
@@bojanvmk Sure laravel with octan is much faster than lumen
But lumen is faster than laravel
Great video Mohamed, I have a question.
By using octane running on swoole we can easily run Jobs in the background and we won't use Supervisor anymore, right?
You need Supervisor to keep Octane running. And you still need it to keep your queue workers running as well. Octane isn't a replacement for queue workers.
@@themsaid thank you for the great video. Could you explain a little bit when we want to use queue workers vs Octane's concurrently method ? Is there a drawback of using concurrently in some cases ? Can we say that we use queues for tasks for which we don't need return information (ex. sending mail in background) ?
Thanks a lot Mohammed. But I wonder how its handle db connections on Octane with Swoole. Is there any connection pools for not to create a db connection for every request or every request is new db connection same as classic php fpm application?
Octane holds a single DB connection per worker. So no need for connection pooling until we decide to support coroutines.
@@themsaid awesome. Thanks
start with Laravel Octane with swoole php extension ,that is incredibly fast due to swoole cache instead of any other cache driver.Thanks
Can I use swools on windows ?
why it doesn't download the swoole when installing?
Sorry but i would have a question using a multitenant app, specially with the tenancy provider configureRequest, so when swoole builds the app, cant find the tenant ti use cause logically is not getting any request, so my question is where is the best place to move that logic, and thanks a lot you are a hero
Well i created a global middleware that is in charge on configuring the tenant snd seems to work fine, i noticed that the initial memory used is like 23mb is it normal? And then for every request my memory goes up, so i guess i have a memory leak somewhere
Seems like you have a memory leak yes. These are hard to detect, I'm afraid there's no easy way :)
thanks for your video. can you please make one video about laravel octane multi-tenancy app, please?
Hello @mahmudul, have you complete multitenant app with seperated DBs ? And which package are used ? if Yes so please contact me twitter @DevDhruvJoshi ,
@@thedhruvjoshi I'm working on separate DB multi-tenant app. I don't use any package for it, i use my own package based on this channel multi-tenant video idea.
@@mahmudulhasan1360 can you share video links, sorry but I couldn't find any video on your channel, so please
@@thedhruvjoshi on this channel, I don't have any video. This channel have one. Mohammed share that
What exactly do you want to know?
Hello Mohamed. I want to access singleton class in web app from Octane::tick . I understood both of them work different php instance. How to access it. If I don't access, could you develop swoole for this :)
Amazing video! I have one question regarding the adding to a static array. If only the container instance is cached and cloned, how come code that isn’t in the scope of the framework is affected by the stateful behavior?
You have to restart the server
Swoole make PHP grate again !
Can octane concurrent run query builder request to DB ?
yes
@@themsaid Thank you. Subbed. Great content, will try octane later this week :)
This is a very informative video, But I am confused at 12:21,
Can you please guide me on what should I do in this case:
I have a `ThemeViewFinder` class that extends Laravel's `FileViewFinder`.
```
use Illuminate\View\FileViewFinder;
class ThemeViewFinder extends FileViewFinder
{
}
```
And I am using the singleton in the service provider like this:
```
public function register()
{
$this->app->singleton('theme.finder', function ($app) {
$themeFinder = new ThemeViewFinder(
$app['files'],
$app['config']['view.paths']
);
$themeFinder->setHints(
$app->make('view')->getFinder()->getHints()
);
return $themeFinder;
});
}
```
Now, what modifications should I make here?
Nothing! It looks good to me.
@@themsaid Thanks,
At 12:21, I thought you said always pass the closure. That's why I asked that question.
you always say "in-a-stance" but you mean "instance", right? just to be sure, I don't miss anything.
Peache pea
Excuse me, but doesn't laravel code just feel like code porn? I just like reading or looking at Laravel code.
Clear as mud. lol