I am a self-taught AS3/Flex/AIR developer and I have built a system of touchscreen-kiosks running on AIR with remote content managment from an online Flex app.

This is the first time I have done server side stuff, so feel free to correct my question if needed.

Both the AIR apps and the Flex app connect to a mysql database for simple CRUD operations using php scripts and the Zend framework. The kiosks call the server every 30 seconds to update.

All these simple server side php scripts were auto-generated by Flash Builder's data wizard. I did the simple adjusments (gateway.php, config.ini, mysqli connection parameters) and deployed everything to the client's server. This is a a shared-server type.

Now, the system works. But it works slowly. Each create/read/update/delete operation works but I think it should be a lot faster.Also, these operations put a lot of load on the server's cpu.According to the hosting guys, this system opens 6 php-cgi proccesses that take up 40% of the server cpu power, and by doing so slows itself down and other sites hosted on that server.

My questions are:

First of all, is there a problem to begin with or is this performance expexted from the Zend framework?Are the auto-generated scripts written by Flash Builder poorly written and can be optimized?Can this kind of system stay on a shared-hosted-server? Should we move to a VPS server for better performance? Is it posiible that if the tables I created on the mysql database with phpmyadmin weren't optimiatlly built that it would have this kind of impact on performance?

I don't know php or mysql.Any kind of help will be much appriciated.

Saar

Here is the script written by Flash Builder: I havn't added anything - just changed the connection parameters.

/** * The constructor initializes the connection to database. Everytime a request is * received by Zend AMF, an instance of the service class is created and then the * requested method is invoked. */ public function __construct() { $this->connection = mysqli_connect( $this->server, $this->username, $this->password, $this->databasename, $this->port );