dongqiao9015 2014-03-28 10:56
浏览 18

在EC2上用PHP跟踪数据传输

I need to track the amount of data my (logged in) users transfer out of the AWS EC2. I am storing the data on S3, usually 200-300mb per file, so I need to be in control of what account should be limited, etc ...

Any help will be much appreciated!

  • 写回答

1条回答 默认 最新

  • doumi9618 2014-03-28 14:52
    关注

    You probably want to turn on server access logging, which will put very detailed log files into an S3 bucket of your choice which you can then analyze at your convenience to figure out who is using up the most resources.

    http://docs.aws.amazon.com/AmazonS3/latest/dev/ServerLogs.html

    and here is the information it will log for you:

    http://docs.aws.amazon.com/AmazonS3/latest/dev/LogFormat.html

    If the default information is not sufficient, you can tag each logged request with extra information to be included on each logged record, like the users id if you want:

    Custom Access Log Information

    You can include custom information to be stored in the access log record for a request by adding a custom query-string parameter to the URL for the request. Amazon S3 will ignore query-string parameters that begin with "x-", but will include those parameters in the access log record for the request, as part of the Request-URI field of the log record. For example, a GET request for "s3.amazonaws.com/mybucket/photos/2014/08/puppy.jpg?x-user=johndoe" will work the same as the same request for "s3.amazonaws.com/mybucket/photos/2014/08/puppy.jpg", except that the "x-user=johndoe" string will be included in the Request-URI field for the associated log record. This functionality is available in the REST interface only.

    评论

报告相同问题?

悬赏问题

  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应