Author |
Post |
|
#1 Sat Jul 11, 2009 16:09, 185 months ago.
|
Member
Registered: Jul 2009
Location: United Kingdom
|
Hi everybody
At the moment because I could not install my sms server on the same network of my main server. I am accessing to the data base remotely and did the script to loop it. but this design I believe I'm loading the network and the server without any needs.
the ideal design I can think at the moment is the following
leave the main server as its (logistic reason to keep a copy of the database in there and fast bandwidth, giving as a result a good customer experience) it takes about 3 sec to get the data into the database.
I could add a routing to add a second copy of the data into the sms server database, reliacing the sms server to checking every x secong into the main server database in across another network.
The only problem I see on this approach is that because the sms server link is not that fast I could introduce delay to the customer experience which can result on customer wait
What do you think? Is there another topology I am missing out? (I was thinking the main server send a message to the sms server when a data is introduce into the database, but I don't have a clue how could it be implemented)
Thank you for your help!
|
|
#2 Sun Jul 12, 2009 19:19, 185 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
You are running sms server behind a DSL link which has no fixed IP? Therefore services, like Apache, are not shown outside? I think that link speed itself is not a problem (if it's more than GPRS ). If you have fixed IP and ports open, you could create sms.php script to the sms server. This script could be called by the main server with &To= and &Message= arguments and then messages are sent as soon as possible. If this kind of service is possible to create to the sms server, there is sample script smstest.php in the scripts directory of a package. With this script character set issues can be seen and resolved.
|
|
#3 Tue Jul 14, 2009 09:21, 185 months ago.
|
Member
Registered: Jul 2009
Location: United Kingdom
Topic owner
|
Yes that right, the sms server is running DSL link and no fix IP. At the moment the sms server keep looking on the main server database for messages it works fast anyway I get the message sent on the sms services terminal in 3 seconds but I see this approach inefficient it check across the internet every 2 sec aprox. its loading the internet link without any need you could have not message send in whole day and it was keep checking the data every 2 sec.
I will try later the customer send it to the sms server directly and see how it works. obviously this is php code, so it means its running on the main server, but It could mean customer experience delay because the response in the customer browser will not show up until the main server do the save data on the sms database on the sms server.
Hi, I have looked at the smstest.php I think I see what you meant, you pass the argument to and message to the sms server and it create the out going file and put it on the outgoing folder, and because the sms server keep checking that folder as soon as message file is in there it will send it, right?
|
|
#4 Tue Jul 14, 2009 12:53, 185 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
Quote Yes that right, the sms server is running DSL link and no fix IP. At the moment the sms server keep looking on the main server database for messages it works fast anyway I get the message sent on the sms services terminal in 3 seconds but I see this approach inefficient it check across the internet every 2 sec aprox. its loading the internet link without any need you could have not message send in whole day and it was keep checking the data every 2 sec.
Have you measured that this load is really a problem? I think that it's not. Those IP packets are small and if using ip number format in call, even domain name server is not used. This may also speed up messaging. I have a GPS/GPRS mobile tracking application which sends new position data to the server on each couple of seconds. This has not caused any noticeable load on DSL connection. Network connections are for use, not for keeping idle... If you can run web server on your sms server, you could create a script which calls main server once per 10 minutes and tells what is a current IP. Main server can then call sms server, if ports are not blocked (by the operator). Quote I will try later the customer send it to the sms server directly and see how it works. obviously this is php code, so it means its running on the main server, but It could mean customer experience delay because the response in the customer browser will not show up until the main server do the save data on the sms database on the sms server.
The following does not work with IE, but with another clients like FF your PHP code could use print() and flush() functions to send a part of page. For example "Processing, please be patient...." with dots as a progress bar is possible and user friendly. With IE some AJAX code will be needed for this. Quote Hi, I have looked at the smstest.php I think I see what you meant, you pass the argument to and message to the sms server and it create the out going file and put it on the outgoing folder, and because the sms server keep checking that folder as soon as message file is in there it will send it, right?
Yes.
|
|
#5 Sun Aug 16, 2009 23:01, 184 months ago.
|
Member
Registered: Jul 2009
Location: United Kingdom
Topic owner
|
You said" Quote The following does not work with IE, but with another clients like FF your PHP code could use print() and flush() functions to send a part of page. For example "Processing, please be patient...." with dots as a progress bar is possible and user friendly. With IE some AJAX code will be needed for this."
Have you got some examples??? Thanks
|
|
#6 Mon Aug 17, 2009 09:23, 184 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
peteruk2009 wrote You said" Quote The following does not work with IE, but with another clients like FF your PHP code could use print() and flush() functions to send a part of page. For example "Processing, please be patient...." with dots as a progress bar is possible and user friendly. With IE some AJAX code will be needed for this."
Have you got some examples??? Thanks
What I meant was something like this: wait.php:<?php $url = "done.php"; print "Processing, please be patient"; $i = 0;
while (1) { print "."; flush();
sleep(1); $i++; if ($i >= 10) break; }
die('<meta http-equiv="refresh" content="0;URL=' .$url .'" />'); ?> 'php' Syntax Highlight powered by GeSHi done.php:<?php print "Done."; ?> 'php' Syntax Highlight powered by GeSHi This sample has a counter for a loop, but you of course break the loop as soon as your data is stored to the database. After this the browser is just redirected to the new page. Another sample, this one is graphical: wait.php:<?php $url = "done.php"; $i = 0;
print ' <html> <head> <script language="javascript" src="xp_progress.js">
/*********************************************** * WinXP Progress Bar- By Brian Gosselin- http://www.scriptasylum.com/ * Script featured on Dynamic Drive- http://www.dynamicdrive.com * Please keep this notice intact ***********************************************/
</script> </head> <body> <center> <br>Processing, please be patient<br> <script type="text/javascript"> var bar1= createBar(300,15,"white",1,"black","blue",85,7,3,""); </script> </center> </body> </html> ';
flush();
while (1) { sleep(1); $i++; if ($i >= 10) break; }
die('<meta http-equiv="refresh" content="0;URL=' .$url .'" />'); ?> 'php' Syntax Highlight powered by GeSHi If you want to try this, load JavaScript code from here.
|