Re: [PHP] Re: Will PHP ever grow up and have threading?

2010-03-25 Thread Hans Åhlin
MvH / Hans Åhlin
Tel: +46761488019
http://www.kronan-net.com/
irc://irc.freenode.net:6667 - TheCoin



2010/3/25 Rene Veerman rene7...@gmail.com:
 On Thu, Mar 25, 2010 at 6:13 AM, Hans Åhlin ahlin.h...@kronan-net.com wrote:
I admit that if there were native support for threading I
 would use it. But I don´t want the support for threading if it
 slowdown the performance.

 hmm i bet you can use any feature of php to slow things down..

 i think what's been proven by the pro-camp by now is that at least
 some application designs would benefit from threading and shared
 memory.

 imo there's no way to tell up front if threading will be detrimental
 or benefitial to all projects built with php.
 itsa case-by-case thing... aint it?

The problem as I understand it, is that the whole language would be affected,
and project that doesn't use shared memory and/or threading is going
to be affected negatively.
But if there is some way to implement threading and shared memory
without the side effects and keeping the security that php provide to
day, and with the resources that the project have. Then i'm totally
for it.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Will PHP ever grow up and have threading?

2010-03-25 Thread Per Jessen
Tommy Pham wrote:

 I think you're missing my point.  Given your current hardware,
 software, product list, etc... how long does it take to run your
 queries in series?  If you were able to run them in parallel and
 deliver faster response time to the users, would you implement PHP
 thread, if it's available?

I mentioned it yesterday, but perhaps you overlooked it - the mysqlnd
driver supports asynchronous queries.  If you really have an issue with
the elapse time of sequential, but independent database queries,
executing them asynchronously is the obvious solution.  (apart from
tuning the database, but I'm assuming you've already been there).


-- 
Per Jessen, Zürich (11.9°C)


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Will PHP ever grow up and have threading?

2010-03-24 Thread Tommy Pham
On Wed, Mar 24, 2010 at 7:03 PM, Michelle Konzack
linux4miche...@tamay-dogan.net wrote:
 Hello Tommy Pham,

 Am 2010-03-23 18:17:56, hacktest Du folgendes herunter:
 Let's go back to my 1st e-commerce example.  The manufacturers list is
 about 3,700.  The categories is about about 2,400.  The products list
 is right now at 500,000 and expected to be around 750,000.  The site
 is only in English.  The store owner wants to expand and be I18n:
 Chinese, French, German, Korean, Spanish.  You see how big and complex
 that database gets?  The store owners want to have this happens when a
 customer clicks on a category:

 I have something like this similar but my database  is  arround  2 TByte
 and stored on seven Sun Fire X4150  and  I  have  only  two  X4100M2  as
 redunant Front-End.

 Your 750.000 items look a little bit like a gadget database...

 I habe several 10 million rows and 200 columns and this is why I splited
 the Database into seven Severs.

 Even threading would not work on this database, because the botleneck is
 the Disk-IO.

 A query about the Irak-War and Backwater would kill a singel server.

 * show all subcategories for that category, if any
 * show all products for that category, if any,
 * show all manufacturers, used as filtering, for that category and 
 subcategories
 * show price range filter for that category
 * show features  specifications filter for that category
 * show 10 top sellers for that category and related subcategories
 * the shopper can then select/deselect any of those filters and
 ability to sort by manufacturers, prices, user rating, popularity
 (purchased quantity)
 * have the ability to switch to another language translation on the fly
 * from the moment the shopper click on a link, the response time (when
 web browser saids Done in the status bar) is 5 seconds or less.
 Preferably 2-3 seconds. Will be using stopwatch for the timer.

 Nothing special...

 Describtion for the products sould be a seperated server

 Q:  Do you real mean, you put 750.000 product describtions into
    the database and then create a new colum for ech language?

 Your Mini-Shop could be done with redunancy using two Database- and two
 Web-Servrs.

 is not even enterprise requirement.  I may have another possible
 project where # products is over 10 million easily.  With similar

 More the 10 mio products?  Whats this?

 I a in the electronic business, and geting 10 mio products, mean, take
 ANY western manufacturers of microchip manufacturers,  passive  parts,
 connectors and such into a database?

 Put asian manufactures to are arround 30 mio in total.

 If you say, you put the  FITS  data  from  the  ESO  into  it,  I  could
 understand, but your explanation is a little but to unbelivable.

 Thanks, Greetings and nice Day/Evening
    Michelle Konzack
    Systemadministrator
    24V Electronic Engineer
    Tamay Dogan Network
    Debian GNU/Linux Consultant

 --
 Linux-User #280138 with the Linux Counter, http://counter.li.org/
 # Debian GNU/Linux Consultant #
 http://www.tamay-dogan.net/                 Michelle Konzack
 http://www.can4linux.org/                   Apt. 917
 http://www.flexray4linux.org/               50, rue de Soultz
 Jabber linux4miche...@jabber.ccc.de           67100 Strabourg/France
 IRC    #Debian (irc.icq.com)                  Tel. DE: +49 177 9351947
 ICQ    #328449886                             Tel. FR: +33  6  61925193


10+ million products is not hard to believe.  Look at Amazon (my
future possible project is not related to Amazon nor am I endorsing
it).  They sell consumer goods.  Their product skus are about 30
million, and that's not all the consumer goods there are either.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Will PHP ever grow up and have threading?

2010-03-24 Thread Tommy Pham
On Wed, Mar 24, 2010 at 7:53 PM, Michelle Konzack
linux4miche...@tamay-dogan.net wrote:
 Hello Tommy,

 Am 2010-03-23 19:08:36, hacktest Du folgendes herunter:
 The response time, max 5 seconds, will be tested on local gigabit LAN
 to ensure the adequate response (optimized DB  code  proper
 hardware) without worrying about users' connection limit and site's
 upload bandwidth limit (which can easily rectify).  Then thereafter
 will be doing stress test of about 10 concurrent users.  As for the
 major queries, that's where threads come in, IMO, because those
 queries depend on 1 primary parameter (category ID) and 1 secondary
 parameter (language ID).  This particular site starts with 500
 products about 15 categories, without many of those mentioned filters,
 later grew to its current state.

 Because not a singel OSS OnlineStore software support  features  I  need
 for my business, I am coding  a  whole  Waren Wirtschafts System  with
 production checkout and an additional OnlineStore where I sell  products
 which I have bought in VERY big quantities to get my Endproducts cheaper
 in production.

 I start with bneary the same requiements as you, have 18 main categories
 and each has 5 to 40 sub categories.

 Currently I have arround 1700 different products I need  for  production
 but over the tieme I count with 30-50.000 products.

 The server I will use is developed by my own using  a  Marvell  Kirkwood
 MV78200 with an attached Marvell 8-channel SATA/SAS  Raid-0/1/10/5  con-
 troller.  This pig has 2 GByte DDR2 memory and beat anything I have ever
 used in this class.  It is an ARM Microcontroller with 1200MHz.

 The Reference Design I use currently can handel more then 400 requests
 at once...

 If such small machine can handel this, I realy think, you  do  not  know
 what are you talking about...

 My software (Apache2, PHP5 and PostgreSQL 8.3;  Debian GNU/Linux  Lenny)
 installed on this Low-Energy (17W) machine  can  be  scaled  by  adding
 parallel machines to increase performance...

 The machine without harddrives cost me in production  of  1000 pcs  less
 then 300 Euro/machine.

 I am slightely sure, yo make something wrong...

 I will not continue to read ths thread, because it is sick.

 Thanks, Greetings and nice Day/Evening
    Michelle Konzack
    Systemadministrator
    24V Electronic Engineer
    Tamay Dogan Network
    Debian GNU/Linux Consultant

 --
 Linux-User #280138 with the Linux Counter, http://counter.li.org/
 # Debian GNU/Linux Consultant #
 http://www.tamay-dogan.net/                 Michelle Konzack
 http://www.can4linux.org/                   Apt. 917
 http://www.flexray4linux.org/               50, rue de Soultz
 Jabber linux4miche...@jabber.ccc.de           67100 Strabourg/France
 IRC    #Debian (irc.icq.com)                  Tel. DE: +49 177 9351947
 ICQ    #328449886                             Tel. FR: +33  6  61925193


I think you're missing my point.  Given your current hardware,
software, product list, etc... how long does it take to run your
queries in series?  If you were able to run them in parallel and
deliver faster response time to the users, would you implement PHP
thread, if it's available?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Will PHP ever grow up and have threading?

2010-03-24 Thread Hans Åhlin
Threading, Shared memory and PHP

Do PHP really need support for threads?
When and why is it necessary?
Why  should/shouldn't it be implemented in the core?
How can one implement/create similar features right now?

One reason I can imagine it to be useful, is if one has lots of SQL
servers, and would want the script to manage the workload, or that if
the servers might have different data stored that one needs access to.
For example; one SQL server has account information, and another
handles the messaging system, and the third handles generic
information, and the last handles a product catalog with categories.
And with threading, it would be a performance gain to be able to send
the queries simultaneously to different servers.

As for shared memory I think it is safer to use workarounds, but it
would make it easier to create some classes, and would open up a whole
new (high performance) way for classes to access shared data, that
belongs to all objects and sessions.

I also see a problem with shared web hosting, concerning both security
and memory issues.
For example, lets say the host has 10 clients running advanced
systems, that place consistent data in memory, but only 2 clients has
the need for the resources that the host supplies and 1000 connections
at any given time, but the rest of the 10 clients only has 100
connections per day, and uses the same amount of memory as the more
demanding clients.
And then we have the problem with sharing memory across servers.
Then we have the security issue that, if improperly configured/coded,
other user/system can access the data, which arises the need for
sandboxes or access control schemes.

I fund some workarounds to this kind of problem by putting my energy
on the code deign and analysis. I have a feeling that the most of the
ones that yells the most belongs to the power programming group that
skipped the part with architect philosophy.

So basically I don´t need the support of threading or shared memory, I
created the solution that works for me and my partners (with php
only). But I admit that if there were native support for threading I
would use it. But I don´t want the support for threading if it
slowdown the performance.



MvH / Hans Åhlin
Tel: +46761488019
http://www.kronan-net.com/
irc://irc.freenode.net:6667 - TheCoin



2010/3/25 Tommy Pham tommy...@gmail.com:
 On Wed, Mar 24, 2010 at 7:53 PM, Michelle Konzack
 linux4miche...@tamay-dogan.net wrote:
 Hello Tommy,

 Am 2010-03-23 19:08:36, hacktest Du folgendes herunter:
 The response time, max 5 seconds, will be tested on local gigabit LAN
 to ensure the adequate response (optimized DB  code  proper
 hardware) without worrying about users' connection limit and site's
 upload bandwidth limit (which can easily rectify).  Then thereafter
 will be doing stress test of about 10 concurrent users.  As for the
 major queries, that's where threads come in, IMO, because those
 queries depend on 1 primary parameter (category ID) and 1 secondary
 parameter (language ID).  This particular site starts with 500
 products about 15 categories, without many of those mentioned filters,
 later grew to its current state.

 Because not a singel OSS OnlineStore software support  features  I  need
 for my business, I am coding  a  whole  Waren Wirtschafts System  with
 production checkout and an additional OnlineStore where I sell  products
 which I have bought in VERY big quantities to get my Endproducts cheaper
 in production.

 I start with bneary the same requiements as you, have 18 main categories
 and each has 5 to 40 sub categories.

 Currently I have arround 1700 different products I need  for  production
 but over the tieme I count with 30-50.000 products.

 The server I will use is developed by my own using  a  Marvell  Kirkwood
 MV78200 with an attached Marvell 8-channel SATA/SAS  Raid-0/1/10/5  con-
 troller.  This pig has 2 GByte DDR2 memory and beat anything I have ever
 used in this class.  It is an ARM Microcontroller with 1200MHz.

 The Reference Design I use currently can handel more then 400 requests
 at once...

 If such small machine can handel this, I realy think, you  do  not  know
 what are you talking about...

 My software (Apache2, PHP5 and PostgreSQL 8.3;  Debian GNU/Linux  Lenny)
 installed on this Low-Energy (17W) machine  can  be  scaled  by  adding
 parallel machines to increase performance...

 The machine without harddrives cost me in production  of  1000 pcs  less
 then 300 Euro/machine.

 I am slightely sure, yo make something wrong...

 I will not continue to read ths thread, because it is sick.

 Thanks, Greetings and nice Day/Evening
    Michelle Konzack
    Systemadministrator
    24V Electronic Engineer
    Tamay Dogan Network
    Debian GNU/Linux Consultant

 --
 Linux-User #280138 with the Linux Counter, http://counter.li.org/
 # Debian GNU/Linux Consultant #
 http://www.tamay-dogan.net/                 Michelle Konzack
 

Re: [PHP] Re: Will PHP ever grow up and have threading?

2010-03-24 Thread Rene Veerman
On Thu, Mar 25, 2010 at 6:13 AM, Hans Åhlin ahlin.h...@kronan-net.com wrote:
I admit that if there were native support for threading I
 would use it. But I don´t want the support for threading if it
 slowdown the performance.

hmm i bet you can use any feature of php to slow things down..

i think what's been proven by the pro-camp by now is that at least
some application designs would benefit from threading and shared
memory.

imo there's no way to tell up front if threading will be detrimental
or benefitial to all projects built with php.
itsa case-by-case thing... aint it?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php