text
stringlengths
0
2.35k
[1582.24 --> 1586.42] But besides that, there's nothing which actually ties it specifically to single language.
[1586.78 --> 1592.24] Except that the single language has a largest SDK code base to communicate with all the features from WordRunner.
[1592.50 --> 1594.58] But they're just a nuance, quite frankly.
[1594.58 --> 1607.08] Okay, so if I'm used to working with single process PHP style application, I think you touched on this earlier, where it's like I'm restarting the world traditionally when I'm dealing with PHP.
[1607.32 --> 1611.46] One request just restarts the world and basically it's like everything is like a new, right?
[1611.46 --> 1625.22] In this world where instead there's a worker pool, there's a process management happening, do you find that developers have to sort of have a mindset shift to basically to think, okay, there's not just one process here, there's multiple.
[1625.54 --> 1629.58] So does that change sort of the nature of how they program?
[1629.70 --> 1634.60] Do they switch from programming, I guess, a single process to now having multiple processes to contend with?
[1634.94 --> 1638.06] Well, I mean, when PHP runs on scale, you still have multiple processes.
[1638.06 --> 1644.06] They just create it on demand, but you still have like 500 PHP processes running the request.
[1644.42 --> 1648.26] But there is definitely the kind of conception shift in people.
[1649.06 --> 1651.38] It's been much harder earlier, like even a year ago.
[1651.56 --> 1657.68] But now, like the main reason why it's easy these days is because very minimal amount of people write on pure PHP.
[1658.26 --> 1661.52] Unlike Golang, where most of the time you write on pure Golang because you can.
[1661.52 --> 1669.48] Like you may be like using some small HTTP overlay framework, but mostly you're going to be using SPL functions, let's say, to do most of your business stuff.
[1670.04 --> 1671.26] In PHP, it's completely different.
[1671.58 --> 1677.78] You have Symfony or Laravel or our infrastructure framework, Spiral, and they're all managed for you.
[1677.78 --> 1692.60] So the beautiful thing is that all of these frameworks over the time, well, we created our own specifically for this purpose, but all other frameworks, they actually do upgrades and patches, which solves all of these kind of thinking nuances for the engineer.
[1692.98 --> 1696.40] They reboot some parts of the services, like clean up the caches and et cetera.
[1696.40 --> 1705.16] So if you're using modern framework and if you're using Roadrunner, you most likely won't even notice a difference in like 90% of your activities.
[1705.44 --> 1710.86] It's still going to be some nuances, but most of them are already known and have already been solved.
[1711.08 --> 1716.60] If you're using framework which specifically built for Roadrunner like ours, nothing is different for you.
[1716.66 --> 1723.10] Just write code and it's all been managed and like status managed in memory and all completely reset it.
[1723.10 --> 1729.60] So would a PHP developer ever even need to know what's under the hood, what's running their processes?
[1729.92 --> 1734.00] I assume they'll never really come in contact, unless they want to, like come in contact with any go whatsoever.
[1734.26 --> 1737.80] Well, it's like owning a car and being able to drive a car, right?
[1737.90 --> 1744.30] If you have Roadrunner on PHP and default PHP SDK, you can do many, many like wonderful things.
[1744.30 --> 1753.52] You can make PHP respond in like 50 microseconds, like run on the all realms and all the queries, use your PC and like use and all of this stuff.
[1753.78 --> 1757.92] But if you also know Golang, you can do even crazier stuff.
[1758.12 --> 1765.20] Like you can take, for example, machine learning model from Keras, compress it, put it into the Golang SDK and then invoke from PHP.
[1765.38 --> 1769.46] And to the end, you now have machine learning compared to PHP via Golang Bridge.
[1769.46 --> 1774.06] So like you can do these crazy things if you know multiple languages, specifically Golang.
[1774.26 --> 1778.50] And Golang is beautiful because it's so, I mean, it's quite easy to learn it, right?
[1778.56 --> 1783.46] It doesn't have many of these legacy overhead and nuances you have to remember.
[1783.90 --> 1788.98] So it's not required, but if you do, well, you essentially are a superhero in PHP world.
[1789.88 --> 1791.94] Yeah, and also your Hardware project, Anthony.
[1792.20 --> 1794.48] Well, yeah, that's another example how you can use it.
[1794.52 --> 1797.46] It's also written here in Roadrunner and PHP combination.
[1797.46 --> 1801.78] I can show it when it's going to be the right time up to you, Johnny.
[1802.62 --> 1809.88] Well, you know, given that most of our users are going to be listening, not viewing this, we may not be able to show them much.
[1810.00 --> 1811.32] I'll try to walk it through, yeah.
[1811.52 --> 1817.40] I do want to sort of understand, obviously this is an open source project and folks are contributing to it.
[1817.76 --> 1826.02] I do want to understand sort of what are some of the hardest challenges that you encountered, like while sort of coming up with this model.
[1826.02 --> 1833.90] Obviously, you're running a process manager, you have to worry about inter-process communication, you have to worry about sort of how to keep things in memory efficiently and all that stuff.
[1834.02 --> 1839.20] You know, I'm curious as to sort of what are some of those biggest challenges and perhaps that you're still facing.
[1839.20 --> 1844.50] I think, I mean, about the current challenges, what I can speak, I don't think we're facing like a lot of them now.
[1844.64 --> 1849.82] But when we started working on this tool, it's been a number of interesting things to solve.
[1849.90 --> 1854.42] Well, number one, we had to create a protocol to communicate within two different languages.
[1854.42 --> 1858.28] And I had to work over pipes, over Unix sockets and TCP sockets.
[1858.28 --> 1867.64] So it's been like, okay, how are we going to create a low-level IPC protocol if you don't want to jump to like shared memory or all of these things?
[1868.24 --> 1874.82] This being not like a hard conceptual problem because you can always like, default protocol is like net string.
[1874.94 --> 1881.12] You have the lengths of the message with like in a fixed head size and then you have the payload board.
[1881.12 --> 1884.66] So it's quite easy to just read the package between languages.
[1885.08 --> 1893.68] Then obviously it was a problem with doing process manager because PHP sometimes tends not to start if you don't send it right parameters or it might crash.
[1893.84 --> 1897.28] If again, you send an invalid payload, I mean, doesn't do it anymore.
[1897.40 --> 1902.22] It's been like a demo builds and obviously raise conditions on Goal inside.
[1902.70 --> 1906.20] Oh, that was horrible because you can't just write a process manager.
[1906.36 --> 1908.16] No one just writes a process manager.
[1909.36 --> 1910.50] Sorry for the reference.
[1910.50 --> 1912.36] You also need to collect the stats.
[1912.52 --> 1914.64] You also need to watch for the process to restart.
[1914.86 --> 1917.80] You need to collect the SDR, right?
[1917.84 --> 1922.48] You need to understand how many times you invoked it, when it was started.
[1923.02 --> 1925.84] It thinks like, okay, let's check how long this process exists.
[1926.42 --> 1930.14] And you call, let's say, time now and you immediately kill your performance, right?
[1930.16 --> 1934.10] Because it's doing a syscall, well, back in the day, something like that.
[1934.38 --> 1939.40] Or, for example, you have a request coming, but at the same time, the PHP process runs out of the memory.
[1939.40 --> 1943.08] So what's going to happen is going to fail.
[1943.54 --> 1944.56] How are you going to start?
[1944.56 --> 1952.28] It's going to be, it's been so many like little integrational hell and edge cases for this type of work.
[1952.44 --> 1957.92] But like, eventually, like once we jumped from this part, what we managed is another part of the hell.
[1958.30 --> 1963.10] When you have a single server, which has HTTP endpoint, everything is quite easy, right?
[1963.14 --> 1968.38] You have request, pack it into the binary form, send to PHP, and well, Bob's your uncle.
[1968.38 --> 1975.76] But when you're doing HTTP, and then you also want to manage the queue process manager, like cooperate with RabbitMQ.
[1976.30 --> 1983.42] But what happens, what if you have HTTP, which runs a PHP worker, which sends data to queue?
[1983.42 --> 1994.88] So now you have two plugins, which not only have to work, they also have to be created in a correct order, wait for each of them to properly connect, and only then make it work.
[1995.06 --> 2000.08] So like, that was a part of like scratching the head a lot, because it was so hard to solve.
[2000.48 --> 2007.22] With all these dependencies and plugins and hidden dependencies, because like PHP worker can theoretically do anything which it wants.
[2007.22 --> 2017.24] It's like, it can call to queue, and it can invoke HTTP endpoint through the roadrunner to itself, which is, well, I'm not even sure what's going to happen in this case.
[2017.88 --> 2020.02] But that's why we created the container.
[2020.22 --> 2023.46] That's what we contributed to eventually Endure, which solves all these problems.
[2023.72 --> 2029.38] And now, like, there is barely no integrational hell between like plugins and Roadrunner.
[2029.50 --> 2033.10] They all like have interfaces, very easy to connect them together.
[2033.38 --> 2036.54] It's basically become a framework for the application server.
[2036.54 --> 2050.56] So if you have this deployed, is it recommended basically that you have basically a single tenant kind of situation whereby you don't want sort of processes from multiple parties that are not really associated with the same, say, the same company, right?
[2050.56 --> 2062.54] You don't want to run this as some sort of, you know, open to all multi-tenant sort of system, because you could have one process sort of peeking in into what's happening with another process within this sort of, within this world.
[2062.54 --> 2066.58] Or is it isolation between these things running all in the same system?
[2066.88 --> 2067.96] Well, it could be.
[2068.30 --> 2071.36] We can isolate it by many different ways.
[2071.46 --> 2075.38] We can isolate them by running with different permission models in PHP.
[2075.50 --> 2081.26] You can literally forbid most of the functions, which, well, some engineers and hackers will still be able to bypass.
[2081.88 --> 2085.30] You can run them in different user groups and user in different memory spaces.
[2085.30 --> 2091.28] I mean, right now we don't run it in like shared fashion, like old-fashioned shared hostings.
[2091.50 --> 2094.52] It's mostly suitable for the most classic approach now.
[2094.62 --> 2095.38] You have a container.
[2095.86 --> 2102.10] Within this container, you have your application, your APIs, or like other service functions of this application.
[2102.46 --> 2105.30] And it's fully self-contained inside this container.
[2105.30 --> 2110.80] If you work on a multi-tenant model, you don't run 10 different PHP scripts with different users.
[2110.98 --> 2116.50] You solve the multi-tenancy on the, well, application design level within your application domain.
[2117.12 --> 2117.90] I hope it makes sense.