1

I have a EC2 server in China using Amazon AWS China.

It's a server with : Apache 2 and PHP The database is a RDS instance running MySQL (also in china)

The problem: Access from out of China is very slow. (tested from australia, france and Canada). Yes, the server has to stay in China :)

From inside China, access time is perfect.

I also have to refine this problem a bit more: what is slow ? The Bandwidth china <> china is what AWS advertise. The bandwidth outside-china <> china is very very bad. Can go down to as low as 2ko/sc. It can also work fine... it's very random.

Just to be clear, i even tried a realy big server just in case it made difference to the network... to no avail.

The latency (let's ping) is also very slow for a connection to reach China.

So, the first solution i have tried is to setup a reverse proxy (Varnish) with nginx in front (to manage ssl) in a Hong-Kong server. I am trying this because i can get a good access time to Hong-Kong from both China and the Rest of the world.

Now, the application hosted in China on the EC2 server is an Intranet. So very hard to cache anything else than JS, CSS and Pictures. (and those are done with varnish also, and works good)

I did think that perhaps a reverse proxy would be quicker than a direct access, but not very succesfull as yet.

What solutions do i have ? I need to make this website / intranet faster from anywhere is the world and the server has to stay in china.

i am open to any ideas, like: is squid better for this ? a vpn server ?

Notes: It's not a software problem of the intranet. Even with only 1 person it's slow and never more than 20 people on at same time.

Many thanks for any suggestions and advice.

blueweb
  • 21
  • 1
  • 2
  • have you tried putting the static content on S3 and using cloudfront? – Diego Velez Nov 05 '17 at 20:44
  • it's the none static content that is problematic. pages are not broken down into small parts for caching, so each page in dynamic... not static. – blueweb Nov 05 '17 at 21:01

1 Answers1

1

The "Great Firewall" is filtering all connections into and out of China. Generally, all connections suffer, there's a lot of packet loss as well.

As long as the Chinese don't change this (highly unlikely) there's next to nothing you can do. You can speed up content delivery by content caching (e.g. caching proxy) but you can't speed up functionality. Set up a server outside China.

see also: https://en.wikipedia.org/wiki/Great_Firewall

Zac67
  • 10,320
  • 2
  • 12
  • 32
  • so perhaps the only solution is to setup 2 servers: 1 inside china, 1 outside china. But if i do this, if this is the correct place to discuss..., how to i keep database up to date in all locations ? because, with only 1 database in china, it will still be slow outside of china. – blueweb Nov 06 '17 at 12:45
  • You'll need to replicate data and content. For the database, this can be quite difficult if you can't just use a read-only copy. – Zac67 Nov 06 '17 at 14:14
  • 1
    It is best to just consider China a separate region that is not directly tied to the rest of the world. With the issues of encryption, monitoring, etc. Build separate business models for China versus the rest of the world. – John Hanley Nov 07 '17 at 21:42